input
input
This page has been flagged with the following issues:
High-level issues:
Content:
W3C Recommendation
Summary
The input element (<input>) is a multipurpose element for representing form widgets. The type of widget depends on the type attribute of the element.
Overview Table
| DOM Interface | HTMLInputElement |
|---|
HTML information
| Closing Tag | required |
|---|---|
| CSS Display | inline |
| HTML Element Categories | flow phrasing interactive |
The input element behavior varies depending on the value of its type attribute:
- type=button
- type=checkbox
- type=color
- type=date
- type=datetime-local
- type=email
- type=file
- type=hidden
- type=image
- type=month
- type=number
- type=password
- type=radio
- type=range
- type=reset
- type=time
- type=search
- type=submit
- type=tel
- type=text (default if type is not set or empty)
- type=url
- type=week
Examples
This example uses the input element to create different types of input controls.
HTML
<form action="http://example.org/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>
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 Working Draft |
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
External resources
http://www.w3.org/TR/html-markup/input.html#input
This article contains content originally from external sources.
Portions of this content come from the Microsoft Developer Network: [Windows Internet Explorer API reference Article]
This tool helps to make and review comments inline.
How to Use
insert instructions, with images, here