title: Embedded YouTube video doesn't stop in Chrome and IE
body: <p>Few topics on this but no answers for me.</p>
  
  <p>Embedding youtube video in a overlay div:</p>
  
  <pre><code>   &lt;div id="blanket" style="display:none;"&gt;
       &lt;/div&gt;
          &lt;div id="popUpDiv" style="display:none;"&gt;
          &lt;a href="#" onclick="popup('popUpDiv')"&gt;Close&lt;/a&gt;     
          &lt;iframe width="480" height="390" src="https://www.youtube.com/embed/G5AuItKv?rel=0&amp;autoplay=1" frameborder="0" allowfullscreen&gt;&lt;/iframe&gt;                                       
          &lt;/div&gt;
  </code></pre>
  
  <p>On firefox when I close the window the video stops, but not in chrome or internet explorer. </p>
  
  <p>Is there some simple javascript I can use to stop it when the user clicks Close?</p>
  
  <p>TIA </p>
  
  <p>Edit:</p>
  
  <pre><code>    &lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
  &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
  &lt;head&gt;
  &lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8" /&gt;
  &lt;title&gt;Untitled Document&lt;/title&gt;
  &lt;/head&gt;
  
  &lt;body&gt;
  
  &lt;a href="#" onclick="javascript:ytplayer.stop()"&gt;Close&lt;/a&gt;
  
   &lt;iframe width="480" height="390" src="http://www.youtube.com/e/PE1il5znICA?enablejsapi=1&amp;version=3&amp;playerapiid=ytplayer" frameborder="0"  allowfullscreen&gt;&lt;/iframe&gt;
  
  
   &lt;script type="text/javascript"&gt;
  function onYouTubePlayerReady(playerId) {
      ytplayer = document.getElementById("ytplayer");
  }
  
  function stop() {
    if (ytplayer) {
      ytplayer.stopVideo();
    }
  }
  &lt;/script&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>