为什么把聚焦事件里面的参数event,title去掉,效果还是一样?
<script type="text/javascript">
//给input绑定一个聚焦事件
$("input").on("focus",function() {
$(this).val('聚焦')
});
//trigger触发focus
$("button:first").click(function() {
$("input").trigger("focus",['触发默认事件']);
});
//triggerHandler触发focus
$("button:last").click(function() {
$("input").triggerHandler("focus",'没有触发默认事件');
});
</script>trigger("focus",['触发默认事件'])和triggerHandler("focus",'没有触发默认事件')这里面的两个参数是不是都对应着event,title?可是我把input的聚焦事件去掉event,title 结果运行还是一样的