HTML DOM form ÊôÐÔ
¶¨ÒåºÍÓ÷¨
form ÊôÐÔ¿É·µ»Ø¶Ô°üº¬¸Ã°´Å¥µÄ±íµ¥µÄÒýÓá£
Èç¹û°üº¬¸Ã°´Å¥£¬Ôò·µ»ØÒ»¸ö form ¶ÔÏó£¬Èç¹ûδ°üº¬¸Ã°´Å¥£¬Ôò·µ»Ø null¡£
Óï·¨
buttonObject.form
ʵÀý
ÏÂÃæµÄÀý×Ó¿É·µ»Ø¸Ã°´Å¥ËùÊôµÄ±íµ¥µÄ id£º
<html>
<body>
<form id="form1">
<button id="button1">Click me!</button>
</form>
<p>The form containing the button is:
<script type="text/javascript">
x=document.getElementById('button1');
document.write(x.form.id);
</script></p>
</body>
</html>