HTML DOM form ÊôÐÔ

¶¨ÒåºÍÓ÷¨

form ÊôÐÔ¿É·µ»Ø¶Ô°üº¬¸Ã°´Å¥µÄ±íµ¥µÄÒýÓá£

Èç¹û°üº¬¸Ã°´Å¥£¬Ôò·µ»ØÒ»¸ö form ¶ÔÏó£¬Èç¹ûδ°üº¬¸Ã°´Å¥£¬Ôò·µ»Ø null¡£

Óï·¨

buttonObject.form

ʵÀý

ÏÂÃæµÄÀý×Ó¿É·µ»Ø°üº¬°´Å¥µÄ±íµ¥µÄ id£º

<html>
<body>

<form id="form1">
<input type="button" value="Click me!" id="button1" />
</form>

<p>The id of the form containing the button is: 
<script type="text/javascript">
x=document.getElementById('button1');
document.write(x.form.id);
</script></p>

</body>
</html>
VUE