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

前端 未结 7 1778
北荒
北荒 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:44

    If you have Google Chrome, their developer tools have an event listener tool, select the element you want to spy its' event.

    You'll find that trying the both ways lead to the same result, so they are equivalent.

提交回复
热议问题