fmpq.com
源代码:
点击运行
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>Fmpq教程(fmpq.com)</title> </head> <body> <p>想文本域中输入信息并点击重置按钮。</p> <form onreset="myFunction()"> <input type="text" id="myInput"> <input type="reset"> </form> <script> function myFunction() { var x = document.getElementById("myInput"); alert("重置前,文本信息为: " + x.value); } </script> </body> </html>
运行结果