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?
You have to put the event handler in the $(document).ready() event:
$(document).ready(function() { $("#btnSubmit").click(function(){ alert("button"); }); });