jQuery click event on select option not working with jQuery Mobile framework

时光毁灭记忆、已成空白 提交于 2019-12-13 01:17:19

问题


I'm trying to fire a click event on my select options.

This is working fine in FF/Safari if the selectlist is a normal multiselect box like this:

http://jsfiddle.net/YZUBs/47/

However, if i include the jQuery Mobile framework, the click event does not trigger anymore:

http://jsfiddle.net/YZUBs/48/

Anyone?


回答1:


The click event on <option> isn't standard and thus not supported in all browsers.
You should use the onchange event instead of onclick.

You can read all the Q&A in this search, this is the subject for all of them...

Updated fiddle



来源:https://stackoverflow.com/questions/10103076/jquery-click-event-on-select-option-not-working-with-jquery-mobile-framework

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