input element | input 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 |
Members
The input object has these types of members:
Properties
The input object has these properties.
| Property | Description |
|---|---|
|
Sets or retrieves a comma-separated list of content types. | |
|
Sets or retrieves how the object is aligned with adjacent text. | |
|
Sets or retrieves a text alternative to the graphic. | |
|
Sets or retrieves the state of the check box or radio button. | |
|
Retrieves whether the object is fully loaded. | |
|
Sets or retrieves the horizontal margin for the object. | |
|
Sets or retrieves the number of times a sound or video clip will loop when activated. | |
|
Sets or retrieves a lower resolution image to display. | |
|
Sets or retrieves when a video clip file should begin playing. | |
|
Sets or retrieves the URL, often with a bookmark extension (#name), to use as a client-side image map. | |
|
Sets or retrieves the displayed value for the control object. This value is returned to the server when the control object is submitted. | |
|
Sets or retrieves the vertical margin for the object. |
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>
Build date: 3/6/2012

