I want to hide a checkbox.
But also want that, when I click on label associated with corresponding checkbox, the checkbox should get checked/unchecked.
I also want that the checkbox MUST be able to be focused.
I am doing the following:
<div class="menuitem">
<label class="checkbox"><input type="checkbox" value="valueofcheckbox" style="display:none" checked="checked">Option Text</label>
</div>
The problem with above is, I am not able to make focus the checkbox when style="display:none".
To make checkbox focusable I am doing :
$('input', '.menuitem').focus();
IF POSSIBLE, how do I make the hidden checkbox focusable?
tabindexto the label work?<input type="hidden" />to store/send whatever it is.<label for="check">some text</label><input type="checkbox" name="check" style="display: block;"/>type 'name' attribute of checkbox in 'for' attribute of label