BootWiki教程网
源代码:
点击运行
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>BootWiki 教程网</title> <script> function displayResult(){ var x=document.getElementById("reset1").form.id; alert(x); } </script> </head> <body> <form id="form1"> Email: <input id="email" type="text"> <input id="reset1" type="reset"> </form> <button onclick="displayResult()" type="button">显示所属的表单ID</button> </body> </html>
运行结果