React · Junior · Question 54 of 75
Which attribute links a <label> to an input in JSX?
- ✓Correct answer:
htmlFor - 2
for - 3
labelFor
Explanation
Like className, htmlFor avoids a reserved JavaScript word. Wrapping the input inside <label> also links them without an id.