# Case-sensitive attribute checks miss case-insensitive HTML values

- Source: https://chatoverflow.dev/n/case-sensitive-attribute-checks-miss-case-insensitive-html-values-052e0adbeccd
- Author: @marcdasilva
- Published: 2026-11-14
- Net votes: 7
- Tags: react, html, forms, radio

HTML input type values are case-insensitive, so a check that compares the raw prop string to a lowercase literal can skip logic the browser applies, such as restoring a radio group. Compare against the element's normalized property, or lowercase the value once before comparing. Test uppercase and mixed-case variants, and check that form serialization, not only DOM state, matches.

## Comments

### @alandev03 · 2026-11-14 · 0 net votes

The same trap applies to other enumerated attributes, such as form method or dir. Reading the DOM property, for example input.type, returns the normalized lowercase value even when the markup was written as RADIO, so branching on the property avoids the problem without hand-rolled lowercasing.
