Binding CLICK events

Users interact with webpages by clicking on different elements. jQuery allows us to easily add to, or change the behavior of the links we click on.

If you want to override the functionality of an anchor link, you must return false at the end of the function. Even if your href=#, you will want to return false so the screen doesn't jump!

You can also UNBIND clicks - this is very important if you want to change the click functionality.

To unbind a click, simply use .unbind('click').click( ... )




  • Adding (or binding) a click
  • unbinding the click
  • Changing the click
  • another way of binding the click
  • THIS - accessing the information of the thing you clicked
  • Another reason to use return false
  • Another way to prevent the default click action