jQuery: $().click(fn) vs. $().bind('click',fn);

前端 未结 7 1773
北荒
北荒 2020-11-28 03:37

When using jQuery to hookup an event handler, is there any difference between using the click method

$().click(fn)

versus using the bind me

7条回答
  •  迷失自我
    2020-11-28 03:51

    There is one difference in that you can bind custom events using the second form that you have. Otherwise, they seem to be synonymous. See: jQuery Event Docs

提交回复
热议问题