HTML input Tag
HTML input Tag
The input tag specifies an input field where the user can enter data. It is a widely used element of the form element. It has a wide range of variety depending on the type attribute.
Input Types:-
- < input type="text" >
- < input type="checkbox" >
- < input type="color" >
- < input type="submit" >
- < input type="email" >
- < input type="hidden" >
- < input type="image" >
- < input type="month" >
- < input type="number" >
- < input type="radio" >
- < input type="search" >
- < input type="datetime-local" >
- < input type="date" >
- < input type="file" >
- < input type="password" >
- < input type="tel" >
- < input type="range" >
- < input type="reset" >
- < input type="button" >
- < input type="time" >
- < input type="URL" >
- < input type="week" >
Attribute Explanation:-
Attribute | Value | Description |
---|---|---|
accept | file_extension audio/* video/* image/* media_type |
Specifies filter for what file types user can pick from file input dialog box. |
alt | text | Specifies alternate text for images. |
autocomplete | on off |
Specifies whether an input element should have autocomplete enabled. |
autofocus | autofocus | Specifies that input element should automatically get focus when the page loads. |
checked | checked | Specifies that input element should be pre-selected when the page loads. |
dirname | inputname.dir | Specifies that text direction will be submitted. |
disabled | disabled | Specifies that input element should be disabled. |
form | form_id | Specifies that form input element belongs to. |
formaction | URL | Specifies URL of file that will process input control when form is submitted. |
formenctype | application/x-www-form-urlencoded multipart/form-data text/plain |
Specifies how form-data should be encoded when submitting it to server. |
formmethod | get post |
Defines HTTP method for sending data to action URL. |
formnovalidate | formnovalidate | Defines that form elements should not be validated when submitted. |
formtarget | _blank _self _parent _top framename |
Specifies where to display response that is received after submitting the form. |
height | pixels | Specifies height of input element. |
list | datalist_id | Refers to datalist element that contains pre-defined options for input element. |
max | number date |
Specifies maximum value for input element |
maxlength | number | Specifies maximum number of characters allowed in input element. |
min | number date |
Specifies minimum value for input element |
minlength | number | Specifies minimum number of characters required in input element. |
multiple | multiple | Specifies that user can enter more than one value in input element. |
name | text | Specifies name of input element. |
pattern | regexp | Specifies regular expression that input element's value is checked against. |
placeholder | text | Specifies short hint that describes expected value of input element. |
readonly | readonly | Specifies that input field is read-only. |
required | required | Specifies that input field must be filled out before submitting form. |
size | number | Specifies width, in characters, of input element. |
src | URL | Specifies URL of image to use as submit button. |
step | number any |
Specifies interval between legal numbers in input field. |
type | button checkbox color date datetime-local file hidden image month number password radio range reset search submit tel text time url week |
Specifies type input element to display. |
value | text | Specifies value of input element. |
width | pixels | Specifies width of input element. |
Syntax:-
Its syntax is:- < input >
Code Explanation
All Tutorials related to HTML Tags List
HTML Comment Tag
DOCTYPE in HTML
HTML a Tag
HTML abbr Tag
HTML acronym Tag
HTML address Tag
HTML article Tag
HTML aside Tag
HTML audio Tag
HTML b Tag
HTML base Tag
HTML bdi Tag
HTML bdo Tag
HTML blockquote Tag
HTML body Tag
HTML br Tag
HTML button Tag
HTML canvas Tag
HTML caption Tag
HTML cite Tag
HTML code Tag
HTML col Tag
HTML colgroup Tag
HTML data Tag
HTML datalist Tag
HTML dd Tag
HTML del Tag
HTML details Tag
HTML dfn Tag
HTML dialog Tag
HTML div Tag
HTML dl Tag
HTML dt Tag
HTML em Tag
HTML embed Tag
HTML fieldset Tag
HTML figcaption Tag
HTML figure Tag
HTML footer Tag
HTML form Tag
HTML h1 - h6 Tags
HTML head tag
HTML header Tag
HTML hr Tag
HTML html Tag
HTML i Tag
HTML iframe Tag
HTML img Tag
HTML input Tag
HTML ins Tag
HTML kbd Tag
HTML label Tag
HTML legend Tag
HTML li Tag
HTML link Tag
HTML main Tag
HTML mark Tag
HTML meta Tag
HTML meter Tag
HTML nav Tag
HTML noscript Tag
HTML object Tag
HTML ol Tag
HTML optgroup Tag
HTML option Tag
HTML output Tag
HTML p Tag
HTML param Tag
HTML picture Tag
HTML pre Tag
HTML progress Tag
HTML q Tag
HTML ruby Tag
HTML s Tag
HTML samp Tag
HTML script Tag
HTML section Tag
HTML select Tag
HTML small Tag
HTML source Tag
HTML span Tag
HTML strong Tag
HTML style Tag
HTML sub Tag
HTML summary Tag
HTML sup Tag
HTML svg Tag
HTML table Tag
HTML tbody Tag
HTML td Tag
HTML template Tag
HTML textarea Tag
HTML tfoot Tag
HTML th Tag
HTML thead Tag
HTML time Tag
HTML title Tag
HTML tr Tag
HTML track Tag
HTML u Tag
HTML ul Tag
HTML var Tag
HTML video Tag
HTML wbr Tag