title: Unable to add play event with iframe video
body: <p>I am using iframe to play embedded videos links from different sites. I want to attach an <code>onplay</code> event with the video. Here is what I have been trying to do:</p>
  <pre><code>&lt;iframe id=&quot;myFrame&quot; width=&quot;420&quot; height=&quot;315&quot; src=&quot;some url&quot; &gt;
  &lt;/iframe&gt;
  </code></pre>
  
  <pre><code>$('#myFrame').load(function(){
      var iframe = document.getElementById('myFrame');
      var innerDoc = iframe.contentDocument || iframe.contentWindow.document;
      innerDoc.getElementsByTagName(&quot;video&quot;).addEventListener(&quot;click&quot;, test, false);
      
      
      }); 
  </code></pre>
  <p>I tried many solutions but i couldn't solve this problem. I recently started learning js and jQuery.</p>