Input Checkbox autofocus-eigenschap

Definitie en gebruik

autofocus Stelt of retourneert of het selectievak automatisch moet worden gefocust wanneer de pagina wordt geladen.

Deze eigenschap reflects de HTML autofocus-eigenschap.

Zie ook:

HTML Referentiehandleiding:HTML <input> autofocus attribute

Voorbeeld

Vergelijk of het selectievak automatisch wordt gefocust wanneer de pagina wordt geladen:

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

Probeer het zelf

Syntaxis

Geef de autofocus-eigenschap terug:

checkboxObject.autofocus

Stel de autofocus-eigenschap in:

checkboxObject.autofocus = true|false

Eigenschapswaarde

Waarde Beschrijving
true|false

Stelt vast of de selectievak moet worden gefocust wanneer de pagina wordt geladen

  • true - The checkbox receives focus
  • false - Default. The checkbox does not receive focus

Technical details

Return value: Boolean value, returned if the checkbox automatically receives focus when the page is loaded 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