How do you attach a click event handler to an element using jQuery?
Description : Use the .click() method to attach a click event handler to an element.
Answer :
To attach a click event handler to an element using jQuery, use the `.click()` method. For example,`$('#buttonId').click(function() { alert('Button clicked!'); });` binds a click event to the element withID`buttonId`. When the element is clicked, the function inside `.click()` is executed, displaying an alert with the message 'Button clicked!'. This method simplifies event handling by allowing you to directly attach event handlers to elements.