# jsx-a11y/label-has-for ❌ This rule is deprecated. It was replaced by [`jsx-a11y/label-has-associated-control`](label-has-associated-control.md). 🚫 This rule is _disabled_ in the following configs: ☑️ `recommended`, 🔒 `strict`. _This rule was deprecated in v6.1.0. It will no longer be maintained._ Enforce label tags have associated control. There are two supported ways to associate a label with a control: - nesting: by wrapping a control in a label tag - id: by using the prop `htmlFor` (or any configured attribute) as in `htmlFor=[ID of control]` To fully cover 100% of assistive devices, you're encouraged to validate for both nesting and id. ## Rule options This rule takes one optional object argument of type object: ```json { "rules": { "jsx-a11y/label-has-for": [ 2, { "components": [ "Label" ], "required": { "every": [ "nesting", "id" ] }, "allowChildren": false }] } } ``` For the `components` option, these strings determine which JSX elements (**always including** `