问题描述
我在我的网站上有一个复选框,ID为'checkbox1'。我使用查询来执行一些命令,当用户做出如下所示的选择:
$ $ $ $ $'$ checkbox1'。on 'click',函数(e){
//命令去这里
});
在firefox中,当用户点击复选框箭头时,我不要那个。我希望它只响应选择。在safari中,我没有这个问题。当我点击箭头时,只有当我做出选择时,事件才会启动。我怎么解决这个问题?感谢。
事件,使用它:
<$ p $($#$ c $)$('#checkbox1')。on('change',function(e){
//命令去这里
});
I have a check box in my web site with the id 'checkbox1'. I use query to perform some commands when the user makes a selection like so:
$('#checkbox1').on('click', function(e) {
//commands go here
});
In firefox the event handler kicks in when the user clicks on the checkbox arrow. I don't want that. I want it to respond to selections only. In safari I don't have this problem. The event doesn't kick in when I click the arrow, only when i make a selection. How can I solve this problem? Thanks.
What about change()
event, use it:
$('#checkbox1').on('change', function(e) {
//commands go here
});
这篇关于在Firefox中点击事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!