问题描述
我在代码中注册了一些点击事件。它们在Firefox(Windows和Mac)中正常工作,但不在Chrome中执行(尝试过Windows和Mac beta)。 JavaScript的目的是显示正确的
这里是代码:
根据,脚本没有bug。代码有问题吗?
Hai,
选择框,您需要为更改事件而不是点击事件注册处理程序。 Firefox和IE使用click事件很奇怪。
看看这个
>I registered some click events in my code. They function properly in Firefox (Windows and Mac) but don't execute in Chrome (tried Windows and Mac beta).
The purpose of the JavaScript is to show the correct number of text inputs based on the value of the select element.
Here is the code:http://www.savetherobots.org/users/jkost/substitutioncipher.php
The script is bug-free according to Firebug. Is something wrong with the code?
Hai ,
For Select boxes, you need to register a handler for a "change" event rather than a "click" event. It's strange that Firefox and IE work with the click event.
Have a look at this Click event on select option element in chrome
andJQuery Click event not being triggered in Safari?
这篇关于jQuery事件在Firefox中运行,而不是Chrome的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!