input

< html‎ | elements
Jump to: navigation, search

input

This page has been flagged with the following issues:


W3C Candidate Recommendation

Summary

The input element (<input>) is a multipurpose element for representing form widgets. The type of widget depends on the type attribute.


Overview Table

DOM Interface HTMLInputElement

HTML information

Closing Tag The input element is a void element. An input element must have a start tag but must not have an end tag
CSS Display inline
HTML Element Categories flow phrasing interactive

The input element behavior varies depending on the value of its type attribute:

Other valid attributes for the input element are accept, alt, autocomplete, autofocus, checked, dirname, disabled, form, formaction, formenctype, formmethod, formnovalidate, formtarget, height, list, max, maxlength, min, multiple, name, pattern, placeholder, readonly, required, size, src, step, value, width, and global element attributes. Note that some attributes do not apply for certain types.

Internationalization topics related to the input element:

Examples

View live exampleThis example uses the input element to create different types of input controls.

HTML

<form action="http://example.org/survey" method=post>

Name


<input name="control1" type="text" value="Your Name">

Password


<input type="password" name="control2">

Color


<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

Comments


<input type="TEXT" name="control4" size="20,5" maxlength="250">

<input name="control5" type=checkbox checked>Send receipt

<input type="submit" value="OK"><input type="reset" value="reset">

</form>

Usage

To cater for international users see: Managing text direction in form controls

Notes

For code samples, see Form controls part 1 and Form controls part 2: validation on the Windows Internet Explorer sample site.


Related specifications

Specification Status Related Changes
HTML5 W3C Candidate Recommendation

Compatibility

Desktop

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari
Basic support ? ? ? ? ?

Mobile

Feature Android BlackBerry Chrome for mobile Firefox Mobile (Gecko) IE Mobile Opera Mobile Opera Mini Safari Mobile
Basic support ? ? ? ? ? ? ? ?

See also

Related articles

HTML













































  • input






… further results


External resources

http://www.w3.org/TR/html-markup/input.html#input

Attribution

This article contains content originally from external sources.

Portions of this content come from the Microsoft Developer Network: [Windows Internet Explorer API reference Article]