input element | input object

[This documentation is preliminary and is subject to change.]

Creates a variety of form input controls.

HTML5 A vocabulary and associated APIs for HTML and XHTMLDocument Object Model (DOM) Level 2 HTML Specification, Section 1.6.5

Standards information

HTML information

Closing Tagrequired
CSS Displayinline
HTML Element Categoriesflow phrasing interactive

Members

The input object has these types of members:

Properties

The input object has these properties.

PropertyDescription

accept

Sets or retrieves a comma-separated list of content types.

align

Sets or retrieves how the object is aligned with adjacent text.

alt

Sets or retrieves a text alternative to the graphic.

checked

Sets or retrieves the state of the check box or radio button.

complete

Retrieves whether the object is fully loaded.

hspace

Sets or retrieves the horizontal margin for the object.

loop

Sets or retrieves the number of times a sound or video clip will loop when activated.

lowsrc

Sets or retrieves a lower resolution image to display.

start

Sets or retrieves when a video clip file should begin playing.

useMap

Sets or retrieves the URL, often with a bookmark extension (#name), to use as a client-side image map.

value

Sets or retrieves the displayed value for the control object. This value is returned to the server when the control object is submitted.

vspace

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

Community Additions

Show: