Type | Description |
---|---|
datetime | Date and time i.e. year, month, day, hour, minute, second, fractions of a second are all encoded according to the ISO 8601 with the timezone set to UTC. |
datetime-local | Date and time i.e. year, month, day, hour, minute, second, fractions of a second are all encoded according to the ISO 8601 without timezone information. |
date | Date i.e. year, month, day is encoded according to ISO 8601. |
month | A date consist of a year and a month encoded according to ISO 8601. |
week | A date consist of a year and a week number is encoded according to ISO 8601. |
time | It is time i.e. hour, minute, seconds, fractional seconds encoded according to ISO 8601. |
number | It accepts only a numerical value. By default the step attribute specifies the precision to 1. |
range | It is used for input fields that contain a value from a range of numbers. |
It accepts only the email value. It is used for input fields that contain an e-mail address. Example: if anyone tries to enter simple text it will not accept it and force to enter only the email address in the format admin@tutorialride.com | |
url | It accepts only the URL value. It is used for input fields that contain a URL address. Example: if anyone tries to enter simple text it will not accept it and force to enter only the URL address in the format http://www.tutorialride.com or http://tutorialride.com |
<!DOCTYPE HTML>
<html>
<head>
<script type="text/javascript">
function answer()
{
a = document.forms["myform"]["newinput"].value;
document.forms["myform"]["result"].value=a;
}
</script>
</head>
<body>
<form action="/cgi-bin/html5.cgi" method="get" name="myform">
Enter any value : <input type="text" name="newinput" />
<input type="button" value="Result" onclick="answer();" />
<output name="result"> </output>
</form>
</body>
</html>