Latest web development tutorials

HTML DOM Input URL objects

Input URL objects

Input URL object is a new HTML5.

Input URL object representation using type = "url" attribute of the HTML <input> elements.

Note: Internet Explorer 9 (and earlier versions of IE), or Safari browser does not support type = "url" attribute of the HTML <input> elements.

Access Input URL objects

You can use getElementById () function to access using type = "url" <input> element attributes:

var x = document.getElementById ( "myUrl" ); try

Tip: You can also form elements to access the Input URL collection of objects.

Create Input URL objects

You can use document.createElement () method to create using the type = "url" attribute of the <input> element:

var x = document.createElement ( "INPUT");
x.setAttribute ( "type", "url "); try

Input URL object properties

Attributes description
autocomplete Sets or returns the URL field autocomplete attribute value
autofocus Sets or returns the URL field is automatically get the focus when the page loads
defaultValue Sets or returns the URL field default value
disabled Sets or returns the URL field is available
form Returns a reference to the URL field of the form
list It returns a reference to the URL field datalist
maxLength Sets or returns the URL field maxlength attribute values
multiple Sets or returns the URL field whether to allow the user to enter one or more url address.
name Sets or returns the URL field name attribute value
pattern Sets or returns the URL field pattern property value
placeholder Sets or returns the URL field placeholder attribute value
readOnly Sets or returns the URL field is read-only
required Sets or returns the URL field in the form if a required field
size Sets or returns the URL segment size attribute value
step Sets or returns the URL segment step property values
type Returns the URL field of the form element type
value Sets or returns the URL field value attribute value

Standard properties and events

Input URL objects also supports standard attributes and events .


related articles

HTML Tutorial: HTML Forms

HTML Reference Manual: HTML <the INPUT> tag

HTML Reference Manual: HTML <the INPUT> of the type attribute