I have an html iframe that contains just an embeded youtube video. I'm trying to perform an action when the user clicks the video/iframe but does not work. Here is code:
html:
<iframe id="myVideo" autoplay="true" src="https://www.youtube.com/embed/pyvGEnmv1E0"></iframe>
jQuery:
$(function(){
//line in question:
$('#myVideo').contents().find("body").click(function(){
//perform action here
});
});
On the "line in question" above, I have also tried the more simple-
$('#myVideo').click(function(){});
but that fails also. Any help is wonderfully appreciated.
Andrew