[removed] function clear1() { if(confirm("确定要清空数据吗?")) { document.main.text1.value = ""; } } [removed] <body> <form name="main"> <input type="text" name="text1" /> <input type="button" name="Submit" value="清空数据" onClick="return clear1();"> </form> </bo