First, get the form reference
1> through the direct positioning of the way to get
document.getElementById ();
Document.getelementsbyname ();
document.getElementsByTagName ();
2> Get references by collection
Document.forms[]
document.forms["name"
document.forms.name
3> directly by name (applies to forms only)
Ii. getting references to form elements
1> Direct Access
document.getElementById ();
Document.getelementsbyname ();
document.getElementsByTagName ();
2> through the collection to obtain
The form object. Elements gets the collection form object for all the elements in the form. elements[subscript] Form object.
elements["name"
Form object. elements.name
3> directly through the form of name
Form object. Name
Common properties and methods of form elements
1> get the value of a FORM element
Form element object. Value Gets or sets the value
2> Property
Disabled Gets or sets whether a form control disables true false
The form points to a reference to the form that contains this element
3> method
Blur () lost focus
Focus () get focused
The above is a small set for you to introduce the JavaScript operation form example explanation (on), I hope to help you, if you have any questions please give me a message, small series will promptly reply to everyone. Here also thank you very much for the cloud Habitat Community website support!