Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/72.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html 在Firefox中,onmouseover事件不在仅带有输入字段的div标记上触发_Html_Firefox - Fatal编程技术网

Html 在Firefox中,onmouseover事件不在仅带有输入字段的div标记上触发

Html 在Firefox中,onmouseover事件不在仅带有输入字段的div标记上触发,html,firefox,Html,Firefox,我试图在输入字段悬停时显示一个按钮。在chrome和IE中一切正常,但在Firefox中却失败了。下面是一个简单的例子: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html lang="en-US"> <head/> <body> <div onmouseover="alert

我试图在输入字段悬停时显示一个按钮。在chrome和IE中一切正常,但在Firefox中却失败了。下面是一个简单的例子:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<html lang="en-US">
<head/>
<body>
<div onmouseover="alert('Firefox/chrome/ie all trigger me')">foo</div>
<div onmouseover="alert('Chrome/ie trigger me but fire fox won't')">
<input id="date_01" type="text" disabled="" tabindex="1">
</div>
</body>
</html>
将鼠标移到第一个div上会显示警报。在Firefox中,将鼠标移到第二个div上不会触发警报


这在firefox中不能正常工作有什么原因吗?或者任何常见的解决方法?

这可能与输入字段被禁用有关


disabled=”“属性具有误导性-只要您将单词禁用,不管您将其设置为什么,该字段仍将被禁用。

Firefox不会在禁用的表单控件上触发任何事件,显然是出于兼容性原因,但如链接问题中所述,事情开始慢慢发展,虽然没有我希望的那么快…尝试删除该标签中的任何“禁用”引用,但仍然没有骰子。不完全重复的可能重复:已在Firefox 8中解决,但此处提到的问题仍然存在。可能还有关系。