mardi 18 juillet 2017

How to make check a checkbox by clicking on the parent element

As the title says, I am trying to click on a div containing a checkbox and check/uncheck it using only the parent element.

this is the jsfiddle example

http://ift.tt/2tmKQMG

and the codes.

html

<div class="js-form-item">
    <input class="solution-subtype-checkboxes" type="checkbox" id="solution-subtype-checkboxes" value="">
    <label for="edit-tpe-option-a-checkboxes-accs-au-module-note-de-frais" class="option">checkbox label</label>
</div>

css:

.js-form-item{
  border:1px solid red; 
  padding:50px; 
  max-width:100px; 
  max-height:100px; 
}

But I am not sure if this is avaiable




Aucun commentaire:

Enregistrer un commentaire