On my web page I have a button, and some JQuery code. The problem is that when I click the button, the JQuery code is not executed. Clicking the button still does a postback, and seems to ignore the JQuery code. Here is my button:
<button id="btnCancel" class="button" runat="server" ><span>Cancel</span></button>
Here is my JQuery Code:
$(document).ready(function () {
$('#btnCancel').click(function () {
alert('hello');
});
});
what I would like to achieve is that when the button is clicked, a message must be displayed showing "Hello". Am I missing something here?