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
Post a Comment