【发布时间】:2013-10-09 11:05:09
【问题描述】:
我在使用 chrome 时遇到了一个错误(在 Firefox 中没问题)。 这是我的代码,很简单:
<html><head></head>
<body>
<select>
<option onclick="alert('abc');">A</option>
<option>B</option>
</select>
</body>
</html>
在 Firefox 中,当我单击选项 A 时,它将显示警报('abc')。但在 chrome 中,它不会运行。我可以更改 chrome 的设置吗?
有什么建议吗?
谢谢!!!
【问题讨论】:
-
在选择上使用
onchange,并按所选选项过滤。更好的是,不显眼地附加处理程序。
标签: javascript html google-chrome firefox select