选择选项上的jQuery click事件不适用于jQuery Mobile框架 [英] jQuery click event on select option not working with jQuery Mobile framework

查看:75
本文介绍了选择选项上的jQuery click事件不适用于jQuery Mobile框架的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在我的选择选项上触发点击事件.

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

如果选择列表是像这样的普通多选框,则在FF/Safari中可以正常工作:

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

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

但是,如果我包括jQuery Mobile框架,那么click事件将不再触发:

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

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

有人吗?

推荐答案

<option>上的click事件不是标准的,因此并非所有浏览器都支持.
您应该使用onchange事件而不是onclick.

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...

> 更新小提琴

这篇关于选择选项上的jQuery click事件不适用于jQuery Mobile框架的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆