Instance
One component, so many differing kinds.
Syntax
1 |
<enter kind="textual content" placeholder="First identify" /> |
2 |
<enter kind="password" placeholder="Password" /> |
3 |
<enter kind="submit" worth="Login" /> |
End result
Browser Help
The <enter>
tag is supported in all trendy browsers. Learn extra on caniuse.com.
Attributes
The <enter>
tag helps World Attributes in HTML. World Attributes are widespread to all HTML components and can be utilized on all of them (although they could not have a lot of an impact on a few of them).
A generic <enter>
component additionally helps the next attributes:
Many extra attributes are supported primarily based on the kind
of enter being authored.
Enter Varieties
Enter components are available numerous differing types to assist several types of information that could be entered. Under is an inventory of the supported varieties:
-
kind=button
: Merely a button with no information kind -
kind=checkbox
: A set of zero or extra values from a predefined record that’s offered as a checkbox. -
kind=coloration
: A sRGB coloration with 8-bit crimson, inexperienced, and blue parts offered as a coloration picker. -
kind=date
: A knowledge (12 months, month, day) with no time zone offered as a date management. -
kind=datetime-local
: A date and time (12 months, month, day, hour, minute, second, and fraction of second) with no timezone offered as a date and time management. -
kind=electronic mail
: An electronic mail tackle or record of electronic mail addresses offered as a textual content management. -
kind=file
: Zero or extra recordsdata every with a MIME kind and optionally a filename -
kind=hidden
: An arbitrary string hidden from look. -
kind=picture
: A coordinate, relative to a specific picture’s measurement, with the additional semantic that it should be the final worth chosen and initiates type submission offered as a clickable picture or button. -
kind=month
: A date consisting of a 12 months and a month with no time zone offered as a month management. -
kind=quantity
: A numerical worth offered as a textual content management with a spinner management. -
kind=password
: Textual content with no line breaks that will not show delicate data as a person varieties. -
kind=radio
: An enumerated worth offered as a radio button. -
kind=vary
: A numerical worth, with the additional semantic that the precise worth shouldn’t be necessary offered as a slider management or related. -
kind=reset
: Used to reset a type component and offered as a button. -
kind=search
: Textual content with no line breaks offered as a search management. -
kind=submit
: An enumerated worth, with the additional semantic that it should be the final worth chosen and initiates type submission offered as a button. -
kind=tel
: Textual content with no line breaks offered as a textual content management. -
kind=textual content
: Textual content with no line breaks offered as a textual content management. -
kind=time
: A time (hour, minute, seconds, fractional seconds) with no time zone offered as a time management. -
kind=url
: An absolute URL offered as a textual content management. -
kind=week
: A date consisting of a week-year quantity and per week quantity with no time zone offered as per week management.
Content material
Inputs don’t assist content material and are thought of a void component.
Cell System Issues
- Management labeling: For higher usability and accessibility label all enter controls appropriately.
- Accessibility: Decrease person typing by specifying enter varieties correctly. On cellular units, totally different keyboard configurations are displayed relying on the enter kind presently in focus: