Bind and Unbind an Event from an Element using Javascript

by Sasikumar 2014-06-10 22:03:09

To bind an event to an element use the following procedure,

Bind Example:
 $( "#myId" ).bind( "click", callbackfunction);

To unbind an event to an element use the following procedure,

Unbind Example:
 $( "#myId" ).unbind( "click", callbackfunction);
We can use any class or id or selector in this process. By using this the above example click event is removed from the element.
Similarly we can use any event namely mouseover, mouseout, etc.

"callbackfunction" is optional.
758
like
0
dislike
0
mail
flag

You must LOGIN to add comments