From the course: jQuery Essential Training

Unlock the full course today

Join today to access over 22,400 courses taught by industry experts or purchase this course individually.

Binding and unbinding events

Binding and unbinding events - jQuery Tutorial

From the course: jQuery Essential Training

Start my 1-month free trial

Binding and unbinding events

- [Instructor] Let's start with the basics and see how to use jQuery to wire up event handlers on a web page. Here in the jQuery website, let's click on the API documentation and then scroll down to the Events section, and we'll click on the Event Handler Attachment link right here and you'll see that there are several functions that you can use to work on Events. Now, some of these have been deprecated, so you might come across older jQuery code that uses functions like bind and live and die and so on and so forth. But the only functions that we're going to concern ourselves right now are on and off. These are the modern ways, as of jQuery 1.8, to attach and remove event handlers from elements. So those are the ones we're going to exercise in this particular video. Let's jump over to the code and see how they work. So, in your Editor, open up the binding underscore start file, and you can see here I've got my jQuery function, and again, I'm using the shorthand function of declaring…

Contents