Easy Tutorial
❮ Event Oncanplay Jsref Replace ❯

HTML DOM Input URL Object


Input URL Object

The Input URL object represents an HTML <input> element with the type="url" attribute.

Note: Internet Explorer 9 (and earlier versions) or Safari do not support the HTML <input> element with the type="url" attribute.

Accessing the Input URL Object

You can access an <input> element with the type="url" attribute using the getElementById() function:

Tip: You can also access the Input URL object through the elements collection of the form.

Creating an Input URL Object

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

Input URL Object Properties

Property Description
autocomplete Sets or returns the autocomplete attribute value of the URL field
autofocus Sets or returns whether the URL field should automatically get focus when the page loads
defaultValue Sets or returns the default value of the URL field
disabled Sets or returns whether the URL field is enabled or disabled
form Returns a reference to the form that contains the URL field
list Returns a reference to the datalist that contains the URL field
maxLength Sets or returns the maxlength attribute value of the URL field
multiple Sets or returns whether the URL field allows the user to enter one or multiple URLs
name Sets or returns the name attribute value of the URL field
pattern Sets or returns the pattern attribute value of the URL field
placeholder Sets or returns the placeholder attribute value of the URL field
readOnly Sets or returns whether the URL field is read-only
required Sets or returns whether the URL field is required in the form
size Sets or returns the size attribute value of the URL field
step Sets or returns the step attribute value of the URL field
type Returns the form element type of the URL field
value Sets or returns the value attribute value of the URL field

Standard Properties and Events

The Input URL object also supports the standard properties and events.


Related Articles

HTML Tutorial: HTML Forms

HTML Reference: HTML <input> Tag

HTML Reference: HTML <input> type Attribute

❮ Event Oncanplay Jsref Replace ❯