I have the following HTML content:
<span onclick="alert('Boem')">
<button id="test1">test</button>
</span>
When I call the following JavaScript code:
$('#test1').trigger('click');
The onclick event is triggered twice, while I expect it to just trigger once. Because jQuery should look up in the DOM tree and find only one onclick.
I do not have control of the span, it is generated in a third party tool. I do have control over the button and his parameters.
You can find a JSFiddle example here: http://jsfiddle.net/Voga/v4100zke/
I do not know the contents of the onclick listener of the span. This is also generated by the third-party tool. I want the click trigger to execute this onclick like it does now, but only once.