JavaScript Reference/Javascript Properties/form — различия между версиями
Admin (обсуждение | вклад) м (1 версия) |
|
(нет различий)
|
Текущая версия на 11:21, 26 мая 2010
"form" Example
<source lang="javascript">
<html> <body> <script language="JavaScript"> function function1(form) {
var elem = document.getElementById("myfunction1").form.id; alert(elem); return true;
} </script> <form id="myF"> <input id="myfunction1"
type="button" value="Get ID of this control"s form" onClick="function1(this.form);">
</form> </body> </html>
</source>
"form" is applied to
<source lang="javascript">
+----------------+--------------------------------------------------------------+ | Applied_To |<button> <fieldset> (IE6) | | |<input type="button"> <input type="checkbox"> | | |<input type="file"> <input type="hidden"> | | |<input type="image"> <input type="password"> | | |<input type="radio"> <input type="reset"> | | |<input type="submit"> <input type="text"> | | |<isindex> <label> | | |<legend> <object> | | |<option> <select> | | |<textarea> | +----------------+--------------------------------------------------------------+
</source>
"form" Syntax and Note
<source lang="javascript">
Note: Read-only property. Returns a reference to the <form> element.
Value: An object null (if the container element is not a <form>).
Syntax:
document.getElementById("elementID").form document.all.elementID.form // IE only
</source>