Posted in Javascript onJune 19, 2014
<script type = "text/javascript" language = "javascript"> function clear1() { if(confirm("确定要清空数据吗?")) { document.main.text1.value = ""; } } </script> <body> <form name="main"> <input type="text" name="text1" /> <input type="button" name="Submit" value="清空数据" onClick="return clear1();"> </form> </body>
confirm的用法示例用于按钮操作时确定是否执行
- Author -
whsnow声明:登载此文出于传递更多信息之目的,并不意味着赞同其观点或证实其描述。
Reply on: @reply_date@
@reply_contents@