HTML & CSS · Middle · Question 39 of 75

What does tabindex="-1" do?

Explanation

tabindex="0" adds an element to the natural tab order, while -1 makes it focusable only via JS (e.g. a modal heading or a container when following an anchor). Positive values change the tab order and are considered an anti-pattern. To remove an element from interaction entirely, use the inert attribute.

Further reading

Problem with a question

HTML & CSS · Middle · question 39

Test yourself

Take the HTML & CSS · Middle quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz