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

报告相同问题?

悬赏问题

  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 对于相关问题的求解与代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 信号傅里叶变换在matlab上遇到的小问题请求帮助
  • ¥15 保护模式-系统加载-段寄存器
  • ¥15 电脑桌面设定一个区域禁止鼠标操作
  • ¥15 求NPF226060磁芯的详细资料