Input Range autofocus eigenschap

Definitie en gebruik

autofocus Stel de eigenschap in of keer de eigenschap terug om te bepalen of de schuifregelaarcomponent automatisch de focus moet krijgen bij het laden van de pagina.

Deze eigenschap reflects de HTML autofocus eigenschap.

Zie ook:

HTML Referentie Handboek:HTML <input> autofocus attribute

Voorbeeld

Vergelijk of de schuifregelaarcomponent automatisch de focus krijgt bij het laden van de pagina:

var x = document.getElementById("myRange").autofocus;

Probeer het zelf

Syntaxis

Keer de autofocus-eigenschap terug:

rangeObject.autofocus

Stel de autofocus-eigenschap in:

rangeObject.autofocus = true|false

Eigenschapswaarde

Waarde Beschrijving
true|false

Regel dat de schuifregelaarcomponent de focus moet krijgen wanneer de pagina wordt geladen.

  • true - the slider control receives focus
  • false - default. The slider control does not receive focus

Technical details

Return value:

Boolean value, if the slider control automatically receives focus when the page is loaded, it returns true; otherwise return false.

Browser support

The numbers in the table indicate the first browser version to fully support this attribute.

Chrome Edge Firefox Safari Opera
Chrome Edge Firefox Safari Opera
Support 10.0 Support Support Support