jQuery触发器无法在IE中运行。为什么? [英] jQuery trigger not working in IE. Why?
本文介绍了jQuery触发器无法在IE中运行。为什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
$('#XynBp0').find('input').each(function(){
if ($(this).attr('value') == 'Cancel'){
$(this).trigger('click');
}
});
在IE7中不起作用
推荐答案
这很奇怪,但尝试创建自定义事件
it's strange but try to create a custom event
$('#XynBp0 input').bind('custom',function(){
//code
})
$('#XynBp0').find('input').each(function(){
if ($(this).attr('value') == 'Cancel'){
$(this).trigger('custom');
}
});
这有效吗?
这篇关于jQuery触发器无法在IE中运行。为什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文