Rules Hub
Coding Rules Library
← Back to all rules
Rule priority, scope & exceptions
Use this to align rules with the senior-level structure (P0/P1/P2, scope, exceptions/tradeoffs).
frontend ruleP1universalStack: react
accessibilityformshtmla11y
Link label and input via matching htmlFor and id
Set htmlFor on the label to the same value as the input's id so clicking the label focuses the control (accessibility).
PR: frontpage-web · org-mining-hist-2026-06Created: Jun 18, 2026
Bad example
Old codetypescript
| 1 | <label htmlFor={name}>{label}</label> |
| 2 | <input name={name} /> |
Explanation (EN)
Objašnjenje (HR)
Good example
New codetypescript
| 1 | <label htmlFor={name}>{label}</label> |
| 2 | <input id={name} name={name} /> |
Explanation (EN)
Objašnjenje (HR)