Question
Checkboxes in html forms don't have implicit labels with them. Adding an explicit label (some text) next to it doesn't toggle the checkbox.
Answer
Set the CSS "display" property for the label to be a block element and use that instead of your div - it keeps the semantic meaning of a label while allowing whatever styling you like.
For example
<label for="test" style="width: 100px; height: 100px; display: block; background-color: #e0e0ff;">
A ticky box! <input type="checkbox" id="test" />
</label>
< br > via < a class="StackLink" href=" http://stackoverflow.com/questions/2123/" >How do I make a checkbox toggle from clicking on the text label as well?< /a>
0 comments:
Post a Comment