YouTip LogoYouTip

Att Input Type

[![Image 1: HTML input Tag Reference Manual](#) HTML Tag](#) ## Example HTML form with two different input types, text and submit: Username:
[Try it Β»](#) (More examples at the bottom of this page) * * * ## Browser Support ![Image 2: Internet Explorer](#)![Image 3: Firefox](#)![Image 4: Opera](#)![Image 5: Google Chrome](#)![Image 6: Safari](#) All major browsers support the type attribute. However, not all input types work in all major browsers. Please see below for browser support for each input type. * * * ## Definition and Usage The type attribute specifies the type of element to display. Default type is: text. **Tip:** This attribute is not required, but we believe you should always use it. * * * ## Differences Between HTML 4.01 and HTML5 The following input types are new in HTML5: color, date, datetime, datetime-local, month, week, time, email, number, range, search, tel, and url. * * * ## Syntax ## Attribute Values | Value | Description | | --- | --- | | button | Defines a clickable button (usually used with JavaScript to start a script). | | checkbox | Defines a checkbox. | | color New | Defines a color picker. | | date New | Defines a date control (year, month, day, no time). | | datetime New | Defines a date and time control (year, month, day, hour, minute, second, fraction of a second, based on UTC time zone). | | datetime-local New | Defines a date and time control (year, month, day, hour, minute, second, fraction of a second, no time zone). | | email New | Defines a field for an e-mail address. | | file | Defines a file-select field and "Browse..." button, for file uploads. | | hidden | Defines a hidden input field. | | image | Defines an image as a submit button. | | month New | Defines a month and year control (no time zone). | | number New | Defines a field for entering a number. | | password | Defines a password field (characters are masked). | | radio | Defines a radio button. | | range New | Defines a control for entering a number where the exact value is not important (like a slider control). | | reset | Defines a reset button (resets all form values to their default values). | | search New | Defines a text field for entering a search string. | | submit | Defines a submit button. | | tel New | Defines a field for entering a telephone number. | | text | Default. Defines a single-line text field (default width is 20 characters). | | time New | Defines a control for entering a time (no time zone). | | url New | Defines a field for entering a URL. | | week New | Defines a week and year control (no time zone). | input type examples: * * * ## Example ### Input Type: button ![Image 7: Opera](#)![Image 8: Safari](#)![Image 9: Chrome](#)![Image 10: Firefox](#)![Image 11: Internet Explorer](#) ## Example Defines a clickable button that starts a JavaScript when clicked: [Try it Β»](#) * * * ### Input Type: checkbox ![Image 12: Opera](#)![Image 13: Safari](#)![Image 14: Chrome](#)![Image 15: Firefox](#)![Image 16: Internet Explorer](#) ## Example Checkboxes allow users to select one or more options from a set of choices: I have a bike
I have a car
I have a boat
[Try it Β»](#) * * * ### Input Type: color ![Image 17: Opera](#)![Image 18: Safari](#)![Image 19: Chrome](#)![Image 20: Firefox](#)![Image 21: Internet Explorer](#) ## Example Pick a color from the color picker: Choose your favorite color:
[Try it Β»](#) * * * ### Input Type: date ![Image 22: Opera](#)![Image 23: Safari](#)![Image 24: Chrome](#)![Image 25: Firefox](#)![Image 26: Internet Explorer](#) ## Example Define a date control: Birthday: [Try it Β»](#) * * * ### Input Type: datetime ![Image 27: Opera](#)![Image 28: Safari](#)![Image 29: Chrome](#)![Image 30: Firefox](#)![Image 31: Internet Explorer](#) ## Example Define a date and time control (with time zone): Birthday (date and time): [Try it Β»](#) * * * ### Input Type: datetime-local ![Image 32: Opera](#)![Image 33: Safari](#)![Image 34: Chrome](#)![Image 35: Firefox](#)![Image 36: Int
← Att Input ValueAtt Input Step β†’