

定义和用法
trigger() 方法触发被选元素的指定事件类型。
语法
$(selector).trigger(event,[param1,param2,...])
参数描述
event 必需。规定指定元素要触发的事件。可以使自定义事件(使用 bind() 函数来附加),或者任何标准事件。
[param1,param2,...] 可选。传递到事件处理程序的额外参数。额外的参数对自定义事件特别有用。
实例:
触发 select元素的change事件:
$("button").click(function(){
 $("select").trigger("change");
});$("#selectId").change(function(){
alert("选中的值为:"+$(this).val());
});给select 一个id属性
<select id="sel"></select>
$("#sel").bind("onchange",function(){
//自己写代码,这个就是给select空间添加onchange事件
});function changeProtocol() { 
$('#step4 #protocol').empty(); 
$('#step4 # protocol').append("<option value='"+key+"'>"+value+"</option>"); 
}先清空select,再重新设置option,这个过程结束后,怎么触发change事件?
$("#step #protocol").change();$('#step4 #protocol').trigger('change')$('#step4 # protocol ').bind('change',function(){});