W3School TIY
脚 本 学 堂 www.jbxue.com
编辑您的代码:
<html> <body> <form id="form1"> <input type="submit" id="submit1" /> </form> <p>The id of the form containing the submit button is: <script type="text/javascript"> x=document.getElementById('submit1'); document.write(x.form.id); </script></p> </body> </html>
查看结果: