[jQuery] TESTING: replicate event bubbling in tests

[jQuery] TESTING: replicate event bubbling in tests


Hi,
I was wondering how I could replicate event delegation while testing.
For example:
<div id="myDiv">
<scan id="myScan">hello</scan>
</div>
$('#myDiv').click(function(e) {
$this = $(e.target)
if ( $this.is('scan') )
$this.toggleClass("selectedScan")
});
When I click on the scan in the browser, it works. But if I do this it
doesn't:
$('#myScan').click()
Any help?
Thanks,
Nacho