The <input> tag with a type="url"
attribute creates an input field for URL values.
This field only accepts valid URLs.
An <input> element of type url.
Only valid url values are accepted.
<form action="/tutorial/action.html">
<fieldset>
<legend>Your website</legend>
<input type="url" name="url" style="width:350px"
placeholder="Enter URL..."><br /><br />
<input type="submit" value="Submit">
</fieldset>
</form>
The <input type="url">
creates a field that accepts a URL value.
This input field is validated when submitted. It only accepts null or a valid URL.
<input type="url">
Here is when type="url"
support started for each browser:
Chrome
|
1.0 | Sep 2008 |
Firefox
|
1.0 | Sep 2002 |
IE/Edge
|
10.0 | Sep 2012 |
Opera
|
10.1 | Jun 2009 |
Safari
|
1.0 | Jan 2003 |
Back to <input>