jQuery events work in Firefox, not Chrome

假装没事ソ 提交于 2019-12-24 00:47:29

问题


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?


回答1:


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

and JQuery Click event not being triggered in Safari?



来源:https://stackoverflow.com/questions/1926813/jquery-events-work-in-firefox-not-chrome

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!