What are the different ways to add event listeners in jQuery

jQuery, event listeners, addEventListener, click event, mouseover event, jQuery .on(), jQuery .bind()
This document explains different ways to add event listeners in jQuery, including examples of various event types.
// Using jQuery .on() method $(document).ready(function() { $('#myButton').on('click', function() { alert('Button clicked!'); }); }); // Using jQuery .bind() method (deprecated, use .on() instead) $(document).ready(function() { $('#myButton').bind('click', function() { alert('Button clicked with bind!'); }); }); // Using jQuery .click() shorthand $(document).ready(function() { $('#myButton').click(function() { alert('Button clicked with click()!'); }); }); // Using jQuery .mouseover() shorthand $(document).ready(function() { $('#myDiv').mouseover(function() { $(this).css('background-color', 'yellow'); }); });

jQuery event listeners addEventListener click event mouseover event jQuery .on() jQuery .bind()