我写了一个在js中写了个clear()函数,供html中的按钮调用,结果IE能调用,firefox和chrome都不能调用,代码是这样的:js代码:
function clear(){
 alert("clear!");
 document.getElementById('inpute').value='';
 }
html中的按钮:
<input type="button"
 class="button" value="清空" name="清空"  onclick="clear();" 
 onmouseover=" change();" /> 
请高手帮忙解决一下,谢谢

解决方案 »

  1.   

    js代码:
    function clear(){
     alert("clear!");
     document.getElementById('inpute').value='';
     }
    html中的按钮:
    <input type="button"
     class="button" value="清空" id="inpute" name="清空"  onclick="clear();" 
     onmouseover=" change();" /> 
      

  2.   

    忘记是哪个浏览器了 应该是不支持getElementById的
      

  3.   

    你把你要清空的html控件也贴上来看看
      

  4.   

    document.getElementById()这个应该都支持啊,你firefox debug 看看错误信息
      

  5.   

    js代码:
     function clear(){
      alert("clear!");
      document.getElementById('inpute').value='';
      }
     html中的代码:
     <input type="button"
      class="button" value="清空" name="清空"  onclick="clear();" 
      onmouseover=" change();" /> <input type="text" class="text0" id="inpute"
    style="border: solid thin #9BDEFF; width: 180px" name="seachvo.name"
    value="${seachvo.name}" />
      

  6.   

    能把change()的代码也贴出来吗?
      

  7.   

    好吧,change的代码是:
    function change() {
    $(".button").css('cursor', 'pointer');
    }
      

  8.   

    在js里面本身是存在clear()这个方法的,你现在又重新写了一个clear这个方法,那肯定是调用不到你的方法的,你把方法名称改一下就知道了。