javascript - input type image click event in jquery -


i trying navigate page using jquery

markup :

<input type="image" name="imagebutton1" id="btncancel" src="../images/btn_cancel.gif" /> 

js

 $('input[type="image"][id^="btncancel"]').live('click', function () {         window.location.replace('default.aspx');  }); 

page refreshes, not navigate desired page. when change type=button works.

how achieve same keeping type image ?

$("#btncancel").on('click', function () {         window.location.href = 'default.aspx'; }); 

Comments

Popular posts from this blog

google api - Incomplete response from Gmail API threads.list -

Installing Android SQLite Asset Helper -

Qt Creator - Searching files with Locator including folder -