jQuery Intro

jQuery Intro Quiz

jQuery Intro Exercise

jQuery Basic

jQuery Basic Quiz

jQuery Basic Exercise

jQuery Advance

jQuery Advance Quiz

jQuery Advance Exercise

jQuery Selectors

jQuery Effects

jQuery Events

jQuery Methods and Properties

jQuery Traversing

jQuery CSS and HTML Methods

jQuery on() Method

jQuery on() Method



The on() method is used to attach one or more event handlers for the selected elements and child elements. It is relatively new compared to its previous similar functions like bind(), delegate(), etc. For removing these event handlers, we have to use the off() method.




Its syntax is:- $(selector).on(event,childSelector,data,function,map)


Further Explanation:-


Parameter Description
event Required. Specifies one or more event(s) or namespaces to attach to the selected elements.
childSelector Optional. Specifies that the event handler should only be attached to the specified child elements.
data Optional. Specifies additional data to pass along to the function
function Required. Specifies the function to run when the event occurs
map Specifies an event map containing one or more events to attach to the selected elements.

Code Explanation

All Tutorials related to jQuery Events

All Sections related to jQuery