Take the 2-minute tour ×

I have a rough idea that it hops from <input> to <input> but is there any documentation for it? My purpose was to look for a way to set focus only in css.

share|improve this question
CSS :focus is a selector that applies when that element has focus. I don't think there's a method that CSS can affect the behavior of HTML element. –  Passerby Dec 7 '12 at 3:51

1 Answer 1

up vote 1 down vote accepted

If by "focus" you mean the focused element when tabbing through elements in a rendered page, then the tabindex=nn attribute defines the tabbing order.

According to the W3C Documentation

The following elements support the tabindex attribute: A, AREA, BUTTON, INPUT, OBJECT, SELECT, and TEXTAREA

See also Creating Logical Tab Order with the Tabindex Attribute

share|improve this answer
In html5, any elements can have the attribute tabindex set. It is not always useful though. whatwg.org/specs/web-apps/current-work/multipage/… –  billyswong Dec 7 '12 at 4:59

Your Answer


