Select autofocus attribute

Definition and usage

autofocus Property settings or returns whether the dropdown list should automatically gain focus when the page is loaded.

This attribute reflects HTML autofocus attribute.

See also:

Εγχειρίδιο HTML:HTML <select> Ετικέτα

Example

Find out if the dropdown list will automatically gain focus when the page is loaded:

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

Try it yourself

Syntax

Return autofocus attribute:

selectObject.autofocus

Set autofocus attribute:

selectObject.autofocus = true|false

Attribute value

Value Description
true|false

Specify whether the dropdown list should gain focus when the page is loaded.

  • true - The dropdown list has gained focus
  • false - Default. The dropdown list has not gained focus

Τεχνικές λεπτομέρειες

Αποτελέσματα Επιστροφής: Βοολον, αν η λίστα κλικ αποκτά αυτόματα έμφαση κατά τη φόρτωση της σελίδας, επιστρέφει αληθές; Διαφορετικά, επιστρέφει ψευδές.

Υποστήριξη Βrowser

Τα αριθμήματα στο πίνακα σημειώνουν την έκδοση του προγράμματος περιήγησης που υποστηρίζει πλήρως την ιδιότητα.

Chrome Edge Firefox Safari Opera
Chrome Edge Firefox Safari Opera
Υποστήριξη 10.0 Υποστήριξη Υποστήριξη Υποστήριξη

Σχετικές Σελίδες

Εγχειρίδιο HTML:HTML <select> Ατζέντα Αυτόματου Εστιασμού