You can attach an event handler to an element using jQuery’s on() method. For example, to attach a click event handler to a button element with the ID “myButton”, you would use the following code:
$('#myButton').on('click', function() {
// code to handle the click event
});