HTML | DOM Input FileUpload autofocus Property
The Input FileUpload autofocus property in HTML DOM is used to set or return whether a file upload button should automatically get focus when the page loads, or not. Syntax:
- Return the autofocus property:
- Set the autofocus property:
- true: The file upload button get focused
- false: It is a default value. The file upload button does not get focused
- It returns the boolean value which represents that upload button is focused or not.
Example-1: Return autofocus property.
Output: Before Click: After Click: Example-2: Set autofocus property.
Output: Before Click: After Click: Supported Browsers:
- Google Chrome
- Mozilla Firefox