<form name=zhuce>
<input type="text" name="wenti" onblur="one()"><span id="ps"></span><br>
<input type="text" name="daan" onblur="two()"><span id="ps1"></span><br>
</form>
<script>
function one(){
if(!document.zhuce.wenti.value)
document.getElementById("ps").innerHTML="<font color='red'>此处不能为空</font>";
else document.getElementById("ps").innerHTM="";
}
function two(){
if(!document.zhuce.daan.value)
document.getElementById("ps1").innerHTML="<font color='red'>此处不能为空</font>";
else document.getElementById("ps1").innerHTML="";
}
</script>
<input type="text" name="wenti" onblur="one()"><span id="ps"></span><br>
<input type="text" name="daan" onblur="two()"><span id="ps1"></span><br>
</form>
<script>
function one(){
if(!document.zhuce.wenti.value)
document.getElementById("ps").innerHTML="<font color='red'>此处不能为空</font>";
else document.getElementById("ps").innerHTM="";
}
function two(){
if(!document.zhuce.daan.value)
document.getElementById("ps1").innerHTML="<font color='red'>此处不能为空</font>";
else document.getElementById("ps1").innerHTML="";
}
</script>
解决方案 »
- 这个影视站的观影历史记录问题。
- js判断浏览器
- 为什么JQuery不起作用!急!
- 求救.关于一个特殊效果显示隐藏层的问题.
- 求一个脚本?
- 請問在javascript中如何獲得<table>的<tbody>中的<tr>和<td>內容
- 关于select的问题继续请教,请zltostem(尘寞)进来领分,当然,最好能够解决后续的问题
- <!--与//-->请问这有什么作用??
- 很多行,每行后面都有一个文本框和按钮,要求点击按钮转到处理页面,怎么得到按下的那个按钮前面文本框的值?
- 新浪论坛里面的树型和那两个蓝色的三角形所实现的功能是怎样实现的?大家有没有兴趣分析一下啊??
- 帮看看哪错了!!!!
- Jquery中下来列表selectbox() ,无法发生onchange事件
<input type="text" name="wenti" onblur="one()"><span id="ps"></span><br>
<input type="text" name="daan" onblur="two()"><span id="ps1"></span><br>
</form>
<script>
function one(){
if(!document.zhuce.wenti.value)
document.getElementById("ps").innerHTML="<font color='red'>此处不能为空</font>";
else document.getElementById("ps").innerHTML="";
}
function two(){
if(!document.zhuce.daan.value)
document.getElementById("ps1").innerHTML="<font color='red'>此处不能为空</font>";
else document.getElementById("ps1").innerHTML="";
}
</script>innerHTML 少了个 L ,要仔细
所有JS全部中断``
将document.getElementById("ps").innerHTM="";改为
document.getElementById("ps").innerHTML="";