0% found this document useful (0 votes)
7 views5 pages

Form 2

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views5 pages

Form 2

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 5

1.

HTML <input type="color">


The <input type="color"> defines a color picker. The default value is #000000
(black). The value must be in seven-character hexadecimal notation.
Ex.
<label for="favcolor">Select your favorite color:</label>
<input type="color" id="favcolor" name="favcolor" value="#ff0000">

2. HTML <input type="date">


The <input type="date"> defines a date picker. The resulting value includes the
year, month, and day.

Ex.

<label for="birthday">Birthday:</label>

<input type="date" id="birthday" name="birthday">

3. HTML <input type="time">


The <input type="time"> defines a control for entering a time (no time zone).

Ex.

<label for="appt">Select a time:</label>

<input type="time" id="appt" name="appt">


4. HTML <input type="datetime-local">
The <input type="datetime-local"> defines a date picker. The resulting value
includes the year, month, day, and time.

Ex.

<label for="birthdaytime">Birthday (date and time) :</label>

<input type="datetime-local" id="birthdaytime" name="birthdaytime">

5. HTML <input type="email">


The <input type="email"> defines a field for an e-mail address. The input value is
automatically validated to ensure it is a properly formatted e-mail address. To
define an e-mail field that allows multiple e-mail addresses, add the "multiple"
attribute.

Ex.

<h3>Show an email field (allows only one email address):</h3>

<label for="email">Enter your email:</label>

<input type="email" id="email" name="email">

<input type="submit">

Ex.

<h3>Show an email field (allows multiple email addresses).

Separate each email address with a comma:</h3>

<label for="emails">Enter email addresses:</label>


<input type="email" id="emails" name="emails" multiple>

<input type="submit">

6. HTML <input type="number">


The <input type="number"> defines a field for entering a number.

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

ex.

<label for="quantity">Quantity (between 1 and 5):</label>

<input type="number" id="quantity" name="quantity"

min="1" max="5">

7. HTML <input type="range">


The <input type="range"> defines a control for entering a number whose
exact value is not important (like a slider control).

Default range is 0 to 100. However, you can set restrictions on what


numbers are accepted with the attributes below.

 max - specifies the maximum value allowed


 min - specifies the minimum value allowed
 step - specifies the legal number intervals
 value - Specifies the default value
Ex.

<label for="vol">Volume (between 0 and 50):</label>

<input type="range" id="vol" name="vol" min="0" max="50">

8. HTML <input type="tel">


The <input type="tel"> defines a field for entering a telephone number.

Ex.

<label for="phone">Enter a phone number:</label><br>

<input type="tel" id="phone" name="phone" placeholder="123-45-678"


required><br><br>

9. HTML <input type="url">


The <input type="url"> defines a field for entering a URL. The input value is
automatically validated before the form can be submitted.

Ex.

<label for="homepage">Add your homepage:</label>

<input type="url" id="homepage" name="homepage">


10. HTML <input type="month">
The <input type="month"> defines a month and year control. The format is
"YYYY-MM".

Ex.

<label for="bdaymonth">Birthday (month and year):</label>

<input type="month" id="bdaymonth" name="bdaymonth">

11. HTML <input type="week">


The <input type="week"> defines a week and year control (no time zone).

Ex. <label for="week">Select a week:</label>

<input type="week" id="week" name="week">

You might also like