`

事件模仿

 
阅读更多
$(function(){
    $('#old').bind("click", function(){
$("input").trigger("focus");
});
$('#new').bind("click", function(){
    $("input").triggerHandler("focus");
});
$("input").focus(function(){
            $("body").append("<p>focus.</p>");
        })
})


<button id="old">trigger</button>
<button id="new">triggerHandler</button>
<input />
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics