How to bind a function to a click on an iframe child

wowser

New Member
I need to \[code\]hide\[/code\] a \[code\]div\[/code\] which is on an \[code\]iframe\[/code\] on iframes child click.\[code\]<a href="http://stackoverflow.com/questions/15702721/#" class="share">Share +</a>\[/code\] -> this is the child I want to do some functions on click.I used this answers JQuery code but it doesn't seem to work.HTML\[code\]<iframe id="map_frame" frameborder="0" src="http://a.tiles.mapbox.com/v3/vucko.map-1p4ens5h.html#17/45.80611110816038/15.924351969962727"></iframe><div>on "share +" click this div must hide so the share box goes above the div</div>\[/code\]JQuery\[code\]$('#map_frame').contents().find('.share').click(function() { alert('click');});\[/code\]Working JSFiddle.How to achieve this ?
 
Back
Top