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 `type="url"`. **Note:** Internet Explorer 9 (and earlier IE versions), or Safari browsers do not support HTML `` elements with `type="url"`. ### Accessing an Input URL Object You can use `getElementById()` to access an `` element with `type="url"`: ```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 `type="url"`: ```javascript var x = document.createElement("INPUT"); x.setAttribute("type", "url"); (#) ## Input URL Object Properties | Property | Description | | --- | --- | | autocomplete | Sets or returns the autocomplete attribute value 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 maxlength attribute value 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 name attribute value 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 a 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 attribute value of the URL field | ## Standard Properties and Events The Input URL Object also supports standard (#) and (#). * * * ## Related Articles HTML Tutorial: (#)
← Prop Url AutofocusDom Obj Url β†’