Jquery使用trigger()方法模拟事件
一、模拟select
$('#selectCount').change(function(){$('select#some').val(10).change();//or$('select#some').val(10).trigger('change');}
二、模拟点击
$("button:first").click(function(){update($("span:first"));});$("button:last").click(function(){$("button:first").trigger('click');update($("span:last"));});functionupdate(j){varn=parseInt(j.text(),10);j.text(n+1);}
声明:本站所有文章资源内容,如无特殊说明或标注,均为采集网络资源。如若本站内容侵犯了原著者的合法权益,可联系本站删除。