accessibility
Focus order
Focus order is the sequence the Tab key walks through a page. When it follows the visual order, tabbing feels invisible; when it doesn't, every press throws you somewhere you didn't expect.
The demo
Click "start", then press Tab to move through this form. Watch the "focus is on" line - in scrambled order it jumps around; switch to natural order and it simply walks down.
Focus isn't in the form yet. Click "start", then press Tab.
What this demo shows (text version)
A contact form with five controls in the visual order: name, email, subject, message, send. In "scrambled" mode the Tab key visits them in a different sequence - email, message, name, subject, send - because each field carries a positive tabindex that overrides its place in the page. A running line announces which field has focus, so the jumps are clear.
Switching to "natural" order removes those overrides, and Tab then walks straight down the form, matching what you see. A focus order that fights the visual order forces keyboard and screen-reader users to rebuild the layout in their head on every press. The fix is to order your markup the way it should be read and never reorder it with tabindex.
In the scrambled form, Tab sent you bouncing - email, then back up to name, then down past the message to the button - and you lost the thread of where you were. Switch it to natural order and the same keypress just walks down the form, the way reading does. That quiet predictability is the whole job of focus order.
Scrambled focus order almost always comes from positive tabindex values (tabindex="2", tabindex="3"...) bolted on to force a sequence. They override the natural DOM order and create exactly the chaos you felt. The fix is usually to delete them all and let the source order do the work - put the markup in the order people should meet it.
My rule: order your HTML the way you want it read, then style position with CSS - never reorder with tabindex. A sighted mouse user may never notice a broken sequence; someone tabbing through, or using a screen reader, lives in it. The visual order and the focus order should be the same order, always.