Tutorials References Menu

HTML <input type="url">

❮ HTML <input> type attribute

Example

Define a field for entering a URL:

<label for="homepage">Add your homepage:</label>
<input type="url" id="homepage" name="homepage">
Try it Yourself »

Definition and Usage

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

The input value is automatically validated before the form can be submitted.

Tip: Always add the <label> tag for best accessibility practices!


Browser Support

The numbers in the table specify the first browser version that fully supports the element.

Attribute
type="url" Yes 10.0 Yes Yes 10.1

Syntax

<input type="url">

❮ HTML <input> type attribute