<input type = "button" onclick="test()">
Js sample code:
$('input[type=button]').on('click',(function(e){
e.preventDefault();
if(!window.confirm(message)) {
return false;
}
}));
I need to stop execution test() for other purposes when click on button. But current situation is it also calling test() instead of return false. Can anyone give suggestion?
onclickattribute?element.removeAttribute('onclick');where element is a reference to the button. ;)