Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

HTML DOM Input URL type Property

Input URL type property

Input URL Object Reference The Input URL object

Example

Return the form element type of the URL field:

var x = document.getElementById("myURL").type;

x

The output is:

url

Try it »


Definition and Usage

The type property returns the form element type of the URL field.

For input type="url", this property usually returns "url".


Browser support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the type property

Note: Internet Explorer or Safari browsers do not support HTML that uses the type="url" attribute. .


Syntax

urlObject

.type

Technical Details

Return Value: A string representing the form element type of the URL field

Input URL Object Reference The Input URL object