I'm trying to put a checkbox in each of my accordion headings to indicate whether something should be disabled or not. The checkbox shows up fine, however, its not clickable as the whole accordion header is linked to the <a>
tag. Putting the checkbox outside the <a>
tag makes the checkbox appear underneath the heading, which is not what I want, and it still isn't clickable either.
<div id="accordion">
<h3><a href="#">Text <span id="id">More text<input type="checkbox"/></span></a></h3>
<div>content etc</div>
</div>
Try setting the checkbox to checked in the acordion click event, using
in the html and
in the event.
You can use
stopPropagation()
to fix thisexample jsfiddle
something like
I would be taking the input control out of the hyperlink.