







Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!








1
Tag Description
**** Defines pre-defined options for input controls
**** Defines a key-pair generator field (for forms)
**** Defines the result of a calculation
New Input Types New Input Attributes Color date datetime datetime-local email month number range search tel time url week
autocomplete autofocus form formaction formenctype formmethod formnovalidate formtarget height and width list min and max multiple pattern (regexp) placeholder required step
College of Information Technology / Department of Information Networks …………….………………………………......................... …………… LEC. (^4) Web Page Design / Second Class / Second Semester
2
The tag specifies a list of pre-defined options for an element.
The tag is used to provide an "autocomplete" feature on elements. Users will see a drop-down list of pre-defined options as they input data.
Use the element's list attribute to bind it together with a element.
NOTE: The list attribute of the element, must refer to the id attribute of the element.
The tag specifies a key-pair generator field used for forms.
When the form is submitted, the private key is stored locally, and the public key is sent to the server.
4
Example:
100 +
=
Value Description color Defines a color picker date Defines a date control (year, month and day (no time))
datetime
The input type datetime has been removed from the HTML standard. Use datetime-local instead.
datetime-local Defines a date and time control (year, month, day, hour, minute, second, and fraction of a second (no time zone) email Defines a field for an e-mail address file Defines a file-select field and a "Browse..." button (for file uploads) hidden Defines a hidden input field image Defines an image as the submit button month Defines a month and year control (no time zone) number Defines a field for entering a number
range
Defines a control for entering a number whose exact value is not important (like a slider control) reset Defines a reset button (resets all form values to default values) search Defines a text field for entering a search string tel Defines a field for entering a telephone number time Defines a control for entering a time (no time zone) url Defines a field for entering a URL week Defines a week and year control (no time zone)
5
Select a color from a color picker: Example
Select your favorite color:
Define a date control:
Example
Birthday:
Define a date and time control (with time zone):
Example
Birthday (date and time):
The input type datetime has been removed from the HTML standard. Use datetime- local instead.
7
Define a hidden field (not visible to a user). A hidden field often stores a default value, or can have its value changed by a JavaScript: Example
First name:
Define an image as a submit button:
Example
First name:
Last name:
Define a month and year control (no time zone): Example
Birthday (month and year):
8
Define a field for entering a number (You can also set restrictions on what numbers are accepted):
Example
Quantity (between 1 and 5):
Use the following attributes to specify restrictions:
max - specifies the maximum value allowed min - specifies the minimum value allowed step - specifies the legal number intervals value - Specifies the default value
Define a control for entering a number whose exact value is not important (like a slider control). You can also set restrictions on what numbers are accepted: Example
Points:
Use the following attributes to specify restrictions:
max - specifies the maximum value allowed min - specifies the minimum value allowed step - specifies the legal number intervals value - Specifies the default value
11
Define a control for entering a time (no time zone): Example
Select a time:
Define a field for entering a URL: Example
Add your homepage:
Tip: Safari on iPhone recognizes the url input type, and changes the on-screen keyboard to match it (adds .com option).
Define a week and year control (no time zone): Example
Select a week:
11
HTML5 introduced a new attribute called placeholder. This attribute on and
This attribute is supported by latest versions of Mozilla, Safari and Chrome browsers only.
Enter email :
This will produce following result :
Now you do not need to have javascript for client side validations like empty text box would never be submitted because HTML5 introduced a new attribute called required which would be used as follows and would insist to have a value −
This attribute is supported by latest versions of Mozilla, Safari and Chrome browsers only.
13
The step attribute specifies the legal number intervals for an element.
Example: if step="3", legal numbers could be -3, 0, 3, 6, etc.
Tip: The step attribute can be used together with the max and min attributes to create a range of legal values.
The step attribute works with the following input types: number, range, date, datetime, datetime-local, month, time and week.