- How do you focus an input element on page load?
- Why is autofocus bad for accessibility?
- What is focus in Web accessibility?
- Why is focus important for accessibility?
How do you focus an input element on page load?
We want that an element should be in focus whenever we load the page. We can do this in 2 ways: Using autofocus attribute of the element. Using Window: load event.
Why is autofocus bad for accessibility?
Accessibility considerations
Automatically focusing a form control can confuse visually-impaired people using screen-reading technology and people with cognitive impairments. When autofocus is assigned, screen-readers "teleport" their user to the form control without warning them beforehand.
What is focus in Web accessibility?
Focus determines where keyboard events go in the page at any given moment. For instance, if you focus a text input field and begin typing, the input field receives the keyboard events and displays the characters you type.
Why is focus important for accessibility?
A focus indicator is essential for accessibility because some people use a mouse or a touch device to access a website, and some rely on using a keyboard to navigate a website. Having a focus indicator will improve the usability of your website and make it accessible.