.click() vs .bind() – jQuery

Difference between .click() and .bind()
.click() is itself an event which will perform some task in function

.bind() is used to bind multiple events with single id or tag

Difference between bind() and live()

bind()
.bind() attacheds events to elements that exist or match the selector at the time the call is made. Any elements created afterward or that match going forward because the class was changed, will not fire the bound event.

live()
.live() works for existing and future matching elements. Before jQuery 1.4 this was limited to the following events: click, dblclick, mousedown, mouseup, mousemove, mouseover, mouseout, keydown, keypress, keyup

Share the joy
  •  
  •  
  •  
  •  
  •  

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.