Input Reset autofocus Eigenschap

Definitie en gebruik

autofocus Eigenschap instellen of teruggeven of de knop 'reset' automatisch 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

Controleer of de knop 'reset' automatisch focus krijgt bij het laden van de pagina:

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

Probeer het zelf uit

Syntax

Teruggeven van de autofocus-eigenschap:

resetObject.autofocus

Instellen van de autofocus-eigenschap:

resetObject.autofocus = true|false

Eigenschapswaarde

Waarde Beschrijving
true|false

Het bepalen of de knop 'reset' focus moet krijgen wanneer de pagina wordt geladen.

  • true - the reset button gains focus
  • false - default. The reset button does not gain focus

Technical details

Return value: Boolean value, returned if the reset button automatically gains focus when the page is loaded true; otherwise return false.

Browser support

The numbers in the table indicate the first browser version that fully supports this attribute.

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