Input FileUpload autofocus attribute
Definition and Usage
autofocus
Set or return whether the file upload button should automatically gain focus when the page is loaded.
This attribute reflects the HTML autofocus attribute.
See also:
HTML Reference Manual:Attribut autofocus de <input> HTML
Example
Determine whether the file upload button will automatically gain focus when the page is loaded:
var x = document.getElementById("myFile").autofocus;
Syntax
Return autofocus attribute:
fileuploadObject.autofocus
Set autofocus attribute:
fileuploadObject.autofocus = true|false
attribute value
value | description |
---|---|
true|false |
规定文件上传按钮是否在页面加载时获得焦点。
|
false - par défaut. Le bouton de téléchargement de fichier n'a pas obtenu le focus
Détails techniques | Valeur de retour : true ; sinon retourne false . |
---|
Compatibilité du navigateur
Chrome | Edge | Firefox | Safari | Opera |
---|---|---|---|---|
Chrome | Edge | Firefox | Safari | Opera |
Support | 10.0 | Support | Support | Support |