jQuery on() Method

Last Updated Jul 21, 2015, 12:00:06 PM





jQuery on() Method

jQuery on() event method is used to attach one or more handler to the matched elements in the DOM tree.

Syntax

jQuery on() method attaches event handlers to the set of selected elements in the jQuery object. As of jQuery 1.7, the jquery on() method provides all functionality required for attaching event handlers.

Example

The above example jquery on() method , everytime you click on the body element it will add another paragraph element with count

Output
jquery on() method

Try It Now

Other Advanced jQuery Events you might want to learn
jQuery Complete Events Reference

jQuery Events

jQuery Document Events

jQuery Keyboard Events

jQuery Mouse Events


Sources and Credits

The content and methods in the tutorial has been referred and updated with jQuery API and The jQuery Foundation

Last Updated Jul 21, 2015, 12:00:06 PM