HTMLInputElement Interface
The HTMLInputElement Interface is the form control. Depending on the environment the value property may be read-only for upload input type. For the "password" input type, the actual value may be masked to prevent unauthorized use.
IDL Definition
Interface HTMLInputElement : HTMLElement {
attribute DOMString defaultValue;
attribute boolean defaultChecked;
readonly attribute HTMLFormElement form;
attribute DOMString accept;
attribute DOMString accessKey;
attribute DOMString align;
attribute DOMString alt;
attribute boolean checked;
attribute boolean disabled;
attribute long maxLength;
attribute DOMString name;
attribute boolean readOnly;
attribute DOMString size;
attribute DOMString src;
attribute long tabIndex;
readonly attribute DOMString type;
attribute DOMString useMap;
attribute DOMString value;
void blur();
void foucs();
void select();
void click();
};
Semantic Requirements
- The defaultChecked attribute represents the HTML value of the element when the type is "Text" or "File" or "Password".
- The defaultChecked attribute represents the checked attribute of the element when the type is "Radio" or "Checkbox".
- The form attribute returns the FORM containing this control.
- The accept attribute is a comma-separated list of content types that a server processing this form will handle correctly.
- The accessKey attribute is a single character access key to give access to the form control.
- The align attribute aligns this object(vertically or horizontally) with respect to the surrounding text.
- The alt attribute alternates text for user agents not rendering the normal content of this element.
- The checked attribute represents the current state of the corresponding form control when the type has the value "Radio" or "Checkbox".
- The disabled attribute indicates that the control is not available in this context.
- The maxLength attribute is the maximum number of text characters for text fields, when type has the value of "Text" or "Password".
- The name attribute is the form control or object name when submitted with a form.
- The readOnly attribute indicates that this control is read-only when type has a value of "text" or "password" only.
- The size attribute contains the size information. Its precise meaning is specific to each type of field.
- The src attribute specifies the location of the image to decorate the graphical submit button when the type has the value "Image".
- The tabIndex attribute is an index that represents the element's position in the tabbing order.
- The type attribute is the type of control created.
- The useMap attribute is the used client-side image map.
- The value attribute is the current form control value.
Methods
- The blur() method removes keyboard focus from this element.
- The focus() method gives keyboard focus to this element.
- The select() method selects the content of the text area for INPUT elements whose type attribute is set to "Text","File" or "Password".
- The click method simulates a mouse click for INPUT elements whose type attribute is "Button","Checkbox","Radio","Reset" or "Submit".
If you have comments or suggestions, email me at mbrady@nist.gov