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

  1. The defaultChecked attribute represents the HTML value of the element when the type is "Text" or "File" or "Password".
  2. The defaultChecked attribute represents the checked attribute of the element when the type is "Radio" or "Checkbox".
  3. The form attribute returns the FORM containing this control.
  4. The accept attribute is a comma-separated list of content types that a server processing this form will handle correctly.
  5. The accessKey attribute is a single character access key to give access to the form control.
  6. The align attribute aligns this object(vertically or horizontally) with respect to the surrounding text.
  7. The alt attribute alternates text for user agents not rendering the normal content of this element.
  8. The checked attribute represents the current state of the corresponding form control when the type has the value "Radio" or "Checkbox".
  9. The disabled attribute indicates that the control is not available in this context.
  10. The maxLength attribute is the maximum number of text characters for text fields, when type has the value of "Text" or "Password".
  11. The name attribute is the form control or object name when submitted with a form.
  12. The readOnly attribute indicates that this control is read-only when type has a value of "text" or "password" only.
  13. The size attribute contains the size information. Its precise meaning is specific to each type of field.
  14. The src attribute specifies the location of the image to decorate the graphical submit button when the type has the value "Image".
  15. The tabIndex attribute is an index that represents the element's position in the tabbing order.
  16. The type attribute is the type of control created.
  17. The useMap attribute is the used client-side image map.
  18. The value attribute is the current form control value.
  19. Methods

  20. The blur() method removes keyboard focus from this element.
  21. The focus() method gives keyboard focus to this element.
  22. The select() method selects the content of the text area for INPUT elements whose type attribute is set to "Text","File" or "Password".
  23. 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