Input URL typeProperty

Input URL 对象参考手册Input URL Object

Examples

Return the form element type of the URL field:

var x = document.getElementById("myURL").type;
xThe output result is:
url

Try it Yourself »

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 <input> elements using the type="url" attribute.


Syntax

urlObject.type

Technical Details

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


Input URL 对象参考手册Input URL Object Other Extensions