<html> <body> <form id="form1"> <input type="checkbox" id="check1" /> </form> <p>包含checkbox的表单id 为: <script type="text/javascript"> x=document.getElementById('check1'); document.write(x.form.id); </script></p> </body> </html>
编辑上面的文字,按下“查看结果”,效果会显示在右边 Create by 软晨网(RuanChen.com)