I have a <div>
with an onclick
event and <checkbox>
, <span>
and <img>
inside it.
When I click on the checkbox then the div-onclick event doesn t fire - I would like it to fire without having to duplicate 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()"
但这只是征兆(未检测):
onclick="this.parent.click()"