Input Radio autofocus Attribute
Definition and Usage
autofocus
Set or return whether the radio button should automatically gain focus when the page is loaded.
This attribute reflects the HTML autofocus attribute.
See also:
HTML Reference Manual:Propriété autofocus de l'élément <input> HTML
Example
Find out if the radio button will automatically gain focus when the page is loaded:
var x = document.getElementById("myRadio").autofocus;
Syntax
Return the autofocus attribute:
radioObject.autofocus
Set the autofocus attribute:
radioObject.autofocus = true|false
attribute value
value | description |
---|---|
true|false |
Définit si le bouton radio doit obtenir le focus au chargement de la page.
|
Détails techniques
Valeur retournée : | Valeur booléenne, renvoyée si le bouton radio obtient automatiquement le focus au chargement de la page true ;sinon retourne false . |
---|
Compatibilité des navigateurs
Chrome | Edge | Firefox | Safari | Opera |
---|---|---|---|---|
Chrome | Edge | Firefox | Safari | Opera |
Support | 10.0 | Support | Support | Support |