Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在使用以下代码:
<s:submit type="input" value="clickme" onclick="func()"/>
并且func()我有一个警报(“hereee”),但是当我单击它时,它会在警报窗口中显示“hereee”。但它也会刷新页面。如何防止页面刷新onclick事件?
func()
任何人都可以帮忙吗?
用于return false防止页面刷新。
return false
<s:submit type="input" value="clickme" onclick="func(); return false;"/>
看演示