label with nested div?
- Dominant language
- No language data
- Stars
- 35
- Forks
- 8
- PR merge metrics
- No merged PRs in 30d
Description
I'm trying to make an `input checkbox` checked when clicking on a `div`, something similar to:
```html
Paragraph inside the div
```
My first idea was to wrap the div inside a `label` where the `for` attribute reference the id of the checkbox:
```html
Paragraph inside the div
```
However this is not html valid as label can't have nested element (other than the element targeted by the for attribute, ie the checkbox):
https://stackoverflow.com/questions/20834755/standards-on-behaviour-of-nested-labels
One solution is to use javascript to check the checkbox with a click event handler on the div.
However I'm looking for a solution without javascript.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.