<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>

解决方案 »

  1.   

    <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").innerHTML="";
    }
    function two(){
    if(!document.zhuce.daan.value)
    document.getElementById("ps1").innerHTML="<font color='red'>此处不能为空</font>";
    else document.getElementById("ps1").innerHTML="";
    }
    </script>innerHTML 少了个 L ,要仔细
      

  2.   

    document.getElementById("ps").innerHTML="";
      

  3.   

    正解``因为当JS还没有运行到错误的那行时`它会正常运行`当JS运行到出错那行之后
    所有JS全部中断``
      

  4.   

    呵呵,因为你少写了一个L
    将document.getElementById("ps").innerHTM="";改为
    document.getElementById("ps").innerHTML="";