dongluoheng3324 2014-11-16 11:31
浏览 122
已采纳

Javascript onmouseover&onmouseout无法禁用按钮[重复]

This question already has an answer here:

I'm trying this piece of code to achieve a button that gets disabled on mouse hover and gets enabled on mouse out.

<input type="button" value="submit" onMouseOver="this.disabled = true;" onMouseOut="this.disabled = false;" />

But it doesn't seem to work. It disables the button on mouse over but doesn't enable it on mouse out. Any suggestions? Thanks!

</div>
  • 写回答

2条回答 默认 最新

  • dongnao9525 2014-11-16 11:46
    关注

    Disabled elements do not fire events. You can place a element over top of the element and listen to the event fired on that element.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?