I have a an iframe which inside there is a video link from somwhere.
I want popup a div when click on iframe.
<a href="javascript:alert();" class="iframelink">
<iframe src="http://www.youtube.com/embed/zDNXx-PgU3k" width="213" height="195" frameborder="0"></iframe>
</a>
$('.iframelink').click(function(){
alert('iframe clicked. Open popup.');
})
How? But because is actually another page javascript cant catch click event.
Is there any way?
Since you have to attach the handler on a link inside an iframe, you should find it inside the iframe. Try this.
contents()reference: http://api.jquery.com/contents/Note that you can only access iframe resources only if it is in the same domain as its parent page.