In JQuery when should you use .bind() over .click() - or any other given event?

后端 未结 5 1431
离开以前
离开以前 2021-02-08 03:22

I understand the difference between Live and Bind but when should I use use .bind() over a \'standard\' event method as shown below.

Are there any key differ

5条回答
  •  清歌不尽
    2021-02-08 03:57

    in "bind" you can use multiple events

    $('#foo').bind('mouseenter mouseleave', function() {
      $(this).toggleClass('entered');
    });
    

提交回复
热议问题