Example
<html>
<title>HTML Tutorials</title>
<body>
<form>
<label>UserName:</label><br>
<input type="text" name="name"><br><br>
<input type="image" alt="Submit" src="login.png" width="100px">
</form>
</body>
</html>
<input type="email">:
The <input> type "email" creates an input filed which allow a user to enter the e-mail address with pattern validation. The multiple attributes allow a user to enter more than one email address.
Example
<input type="number">:
The <input> element type number creates input filed which allows a user to enter the numeric value. You can also restrict to enter a minimum and maximum value using min and max attribute.
Example
<html>
<title>HTML Tutorials</title>
<body>
<form>
<label>Enter your age: </label>
<input type="number" name="num" min="18" max="60">
<input type="submit">
<br><br><br>
<p><strong>Note:It will allow to enter number in range of 18-60. If you want to enter number other than range, it will show an error.</strong></p>
</form>
</body>
</html>
<input type="color">:
The <input> type "color" is used to define an input field which contains a colour. It allows a user to specify the colour by the visual colour interface on a browser.
Example
<html>
<title>HTML Tutorials</title>
<body>
<form>
Pick your Favorite color: <br><br>
<input type="color" name="colour" value="#00000"> Select the colour
</form>
</body>
</html>
<input type="date">:
The <input> element of type "date" generates an input field, which allows a user to input the date in a given format. A user can enter the date by text field or by date picker interface.
Example
<html>
<title>HTML Tutorials</title>
<body>
<form>
Select Start and End Date: <br><br>
<input type="date" name="Startdate"> Start date:<br><br>
<input type="date" name="Enddate"> End date:<br><br>
<input type="submit">
</form>
</body>
</html>
The <input> element of type "url" creates an input filed which enables user to enter the URL.
<input type="datetime-local">:
The <input> element of type "datetime-local" creates input filed which allow a user to select the date as well as local time in the hour and minute without time zone information.
Example
<html>
<title>HTML Tutorials</title>
<body>
<form>
<label>
Select the appointment Date: <br><br>
Select date & time: <input type="datetime-local" name="appointmentdate"> <br><br>
</label>
<input type="submit">
</form>
</body>
</html>
No comments:
Post a Comment