input element | HTMLInputElement object
[This documentation is preliminary and is subject to change.]
Creates a variety of form input controls.
![]() ![]() |
Standards information
- HTML5 A vocabulary and associated APIs for HTML and XHTML
- Document Object Model (DOM) Level 2 HTML Specification, Section 1.6.5
HTML information
| Closing Tag | required |
|---|---|
| CSS Display | inline |
| HTML Element Categories | flow phrasing interactive |
DOM Information
Inheritance Hierarchy
Node
Element
HTMLElement
HTMLInputElement
Remarks
Windows Internet Explorer 8 and later. In IE8 Standards mode, the title attribute is preferred over the alt attribute when specified as a pop-up tooltip. This applies only when the type attribute is set to image. For more information on IE8 mode, see Defining Document Compatibility.
Examples
This example uses the input element to create different types of input controls.
<form action="http://intranet/survey" method=post> <P>Name</P> <br><input name="control1" type=text value="Your Name"> <P>Password</P> <br><input type="password" name="control2"> <P>Color</P> <br><input type="radio" name="control3" value="0" checked>Red <input type="radio" name="control3" value="1">Green <input type="radio" name="control3" value="2">Blue <P>Comments</P> <br><input type="TEXT" name="control4" SIZE="20,5" maxlength="250"> <P><input name="control5" type=checkbox checked>Send receipt</P> <P><input type="submit" value="OK"><input type="reset" value="reset"></P> </form>
See also
Build date: 3/8/2012

