I need to have a button and handle its event in jQuery. And I am writing this code but it\'snot working. Did I miss something?
$('#btnSubmit').click(function(){ alert("button"); });
or
//Use this code if button is appended in the DOM $(document).on('click','#btnSubmit',function(){ alert("button"); });
See documentation for more information: https://api.jquery.com/click/