I am using following code:
<s:submit type="input" value="clickme" onclick="func()"/>
and in func() I have an alert(“hereee”) but when I click it, it shows “hereee” in an alert window. But it also refreshes the page as well. How to prevent page refresh onclick event?
Can anyone help?
Use
return falseto prevent the page refresh.See Demo