我有一个label" for="the pointer to the checkbox input"",只要我知道,这for只能添加label.因此,我需要在labela <button>(我需要它)内部添加,但click事件无法正常工作 - 它不会检查for指向的复选框.
什么是我可以用在这里,如果我必须把可能性<button>里面label,只用HTML + CSS编码?
一些代码例如:
<input type="checkbox" id="thecheckbox" name="thecheckbox">
<div for="thecheckbox"><button type="button">Click Me</button></div>
Run Code Online (Sandbox Code Playgroud)