Eslint-plugin-jsx-a11y: htmlFor versus for?

Created on 21 Dec 2016  路  2Comments  路  Source: jsx-eslint/eslint-plugin-jsx-a11y

Isn't htmlfor is only recognized by IE8 if it's in Compatibility Mode. In Standards Mode, it ignores the htmlfor attribute. In both modes, for works properly. Shouldn't htmlFor be for, or what am I missing?

question

Most helpful comment

https://facebook.github.io/react/docs/dom-elements.html#htmlfor

Since for is a reserved word in JavaScript, React elements use htmlFor instead.

If you use htmlFor on your React element, for will end up in the DOM.

All 2 comments

https://facebook.github.io/react/docs/dom-elements.html#htmlfor

Since for is a reserved word in JavaScript, React elements use htmlFor instead.

If you use htmlFor on your React element, for will end up in the DOM.

Thanks! Sorry for the superfluous issue.

Was this page helpful?
0 / 5 - 0 ratings