I have an input and a label in a div like so:
<div class="dropdown-item">
<input id="inputId" name="filtercheckbox" type="checkbox" />
<label for="inputId">Basic Label</label>
</div>
I want the input checkbox to check/uncheck when the div, label or input is clicked.
I have tried making the label width and height 100% which does not expand to cover the whole div.
I have also tried the solution from this question: change checkbox status (true/ false) on div click
However while clicking the div now toggles the input, clicking the label does not. The JSFiddle with the above implemented solution is here: http://jsfiddle.net/qk1dg79e/1/ This is the closest I have come to the solution.
I am using bootstrap so changing the display property on the div is not an option.
How can I make it so that when the div, label or input is clicked it toggles the input?