HTML DOM Input URL object

Input URL-object

Het Input URL-object is een nieuw object in HTML5.

Het Input URL-object representeren HTML <input type="url">-element.

Opmerking:Internet Explorer 9 (en oudere versies) of Safari ondersteunt het element <input type="search"> niet.

Toegang tot het Input URL-object

U kunt een element van type <input type="url"> bereiken met behulp van de methode getElementById():

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

Probeer het zelf

Maak een Input URL-object aan

U kunt een element van type <input type="url"> maken met behulp van de methode document.createElement():

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

Probeer het zelf

Eigenschap van het Input URL-object

Properties Description
autocomplete Instellen of retourneren van de waarde van de autocomplete-eigenschap van het Search-veld.
autofocus Instellen of retourneren of het Search-veld automatisch moet focus krijgen nadat de pagina is geladen.
defaultValue Set or return the default value of the Search field.
disabled Set or return whether the Search field is disabled.
form Return a reference to the form containing the Search field.
list Return a reference to the datalist containing the Search field.
maxLength Set or return the maxLength attribute value of the search field.
multiple Set or return whether the user is allowed to enter more than one URL address in the URL field.
name Set or return the name attribute value of the Search field.
pattern Set or return the pattern attribute value of the Search field.
placeholder Set or return the placeholder attribute value of the Search field.
readOnly Set or return whether the Search field is read-only.
required Set or return whether the Search field must be filled out before submitting the form.
size Set or return the size attribute value of the Search field.
step Set or return the step attribute value of the Search field.
type Return the form element type of the Search field.
value Set or return the value of the Search field's value attribute.

Input URL object methods

Method Description
blur() Remove focus from the URL field.
focus() Give focus to the URL field.
select() Select the content of the URL text field.

Standard properties and events

The Input URL object supports standardsPropertiesandEvents.

Related pages

HTML tutorial:HTML forms

HTML reference manual:HTML <input> tag

HTML reference manual:HTML <input> type attribute