input-requires-label
rule should allow input tag nested inside label tag
#1170
Labels
help wanted
We are looking for community help
keep-unstale
The issue will not be marked as stale by the stale-bot
PR needed
rule
Relates to HTMLHint's core rules
Currently, the
input-requires-label
rule forces the input tag to have an id attribute to associate a label tag, but the input tag without id attribute can be considered to be associated with a nesting label tag.According to HTML Standard,
So, my idea is to modify the rule to allow the first input tag nested inside a label tag without the for attribute.
Here is a small example: clicking on the "bar" label toggles the "baz" checkbox associated with the for attribute, instead of the nested "bar" checkbox.
https://jsfiddle.net/pL5s0mvk/
The text was updated successfully, but these errors were encountered: