37 out of 56 rated this helpful - Rate this topic

input element | HTMLInputElement 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

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

Reference
button
select
textArea

 

 

Build date: 3/8/2012

Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ