How do I make a checkbox toggle from clicking on the text label as well?

前端 未结 8 1957
一生所求
一生所求 2020-12-15 03:38

Checkboxes in HTML forms don\'t have implicit labels with them. Adding an explicit label (some text) next to it doesn\'t toggle the

8条回答
  •  眼角桃花
    2020-12-15 03:52

    Wrapping with the label still doesn't allow clicking 'anywhere in the box' - still just on the text! This does the job for me:

    Date of birth entry must be completed

    but unfortunately has lots of javascript that is effectively toggling twice.

提交回复
热议问题