Try this:
HTML:
<input type="reset" onclick="return confirm_reset();">
JS:
function confirm_reset() {
return confirm("Are you sure you want to reset all text?");
}
When the onclick
function returns false
, it prevents the default action of the reset button.