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