YouTip LogoYouTip

Dom Obj Url

# HTML DOM Input URL Object * * * ## Input URL Object The Input URL object is new in HTML5. The Input URL object represents an HTML `` element with the `type="url"` attribute. **Note:** Internet Explorer 9 (and earlier IE versions), or Safari browsers do not support the HTML `` element with the `type="url"` attribute. ### Accessing the Input URL Object You can use the `getElementById()` function to access an `` element with the `type="url"` attribute: ```javascript var x = document.getElementById("myUrl"); (#) **Tip:** You can also access the Input URL object through the form's (#) collection. ### Creating an Input URL Object You can use the `document.createElement()` method to create an `` element with the `type="url"` attribute: ```javascript var x = document.createElement("INPUT"); x.setAttribute("type", "url"); (#) ## Input URL Object Properties | Property | Description | | --- | --- | | autocomplete | Sets or returns the value of the autocomplete attribute of the URL field | | (#) | 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 | | (#) | Sets or returns whether the URL field is disabled | | (#) | Returns a reference to the form that contains the URL field | | list | Returns a reference to the datalist that contains the URL field | | (#) | Sets or returns the value of the maxlength attribute of the URL field | | multiple | Sets or returns whether the URL field allows the user to enter one or more URL addresses | | (#) | Sets or returns the value of the name attribute of the URL field | | pattern | Sets or returns the value of the pattern attribute of the URL field | | placeholder | Sets or returns the value of the placeholder attribute of the URL field | | (#) | Sets or returns whether the URL field is read-only | | (#) | Sets or returns whether the URL field must be filled out before submitting the form | | (#) | Sets or returns the value of the size attribute of the URL field | | step | Sets or returns the value of the step attribute of the URL field | | (#) | Returns the form element type of the URL field | | (#) | Sets or returns the value of the value attribute of the URL field | ## Standard Properties and Events The Input URL object also supports standard (#) and (#). * * * ## Related Articles HTML Tutorial: (#)
← Dom Obj UrlProp Input Time Value β†’