How can I pass checkbox onclick event to parent onclick ?
- by Kim
I a with an onclick event and , and inside it.
When I click on the checkbox then the div-onclick event doesnt fire - I would like it to fire without having to dublicate the onclick onto the checkbox.
<div id="id-tag" onclick="do()">
<span>text</span>
<img src="pic.jpg" />
<input type="checkbox" name="mycheck" />
</div>
I know the div-idtag but ideally would like to avoid specifying it inside the checkbox.
Using another function call on the checkbox onclick to call the parent is NOT what I am looking for, like
onclick="run_parent_onclick()"
but this is okay (untested)
onclick="this.parent.click()"