The on() Method
The on() method attaches one or more event handlers for the selected elements.Attach a click event to a <p> element:
Example
$("p").on("click", function(){
$(this).hide();
});
Example
$("p").on({
mouseenter: function(){
$(this).css("background-color", "lightgray");
},
mouseleave: function(){
$(this).css("background-color", "lightblue");
},
click: function(){
$(this).css("background-color", "yellow");
}
});