title: Change src attribute
body: <p>I want to change the src attribute of an embed object. I have:</p>
  
  <pre><code>&lt;embed class="flash "id="flash" src="swf/pano.swf?panoSrc=images/a.jpg" 
                       allowFullScreen="true" 
                       width="1280" height="640" quality="high" 
                       pluginspage="http://www.macromedia.com/go/getflashplayer" 
                       type="application/x-shockwave-flash" bgcolor="#DDDDDD"/&gt;
  </code></pre>
  
  <p>and I've tried</p>
  
  <pre><code>function change() 
  {
     document.getElementById("flash").setAttribute('src', 'swf/pano.swf?panoSrc=b.jpg');
  }
  </code></pre>
  
  <p>but it didn't work in Chrome, "only" in Firefox, IE and Opera. How can I fix it (to make it work in Chrome)? Did I do anything wrong?</p>
  
  <p>EDIT: here is the whole HTML file</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  
  &lt;html lang="en"&gt;
  &lt;head&gt;
      &lt;meta charset="utf-8" /&gt;
      &lt;title&gt;&lt;/title&gt;
      &lt;script&gt;
          function change() {
              document.getElementById("flash").setAttribute('src', 'swf/pano.swf?panoSrc=a.jpg');
          }
      &lt;/script&gt;
  
  &lt;/head&gt;
  &lt;body&gt;
  
  
      &lt;embed class="flash" id="flash" src="swf/pano.swf?panoSrc=images/sau.jpg" allowFullScreen="true" 
                       width="1280" height="640" quality="high" 
                       pluginspage="http://www.macromedia.com/go/getflashplayer" 
                       type="application/x-shockwave-flash" bgcolor="#DDDDDD"/&gt;
  
       &lt;script&gt;
           change();
       &lt;/script&gt;
  
  &lt;/body&gt;
  </code></pre>
  
  <p></p>
  
  <p>Link to the page: <a href="http://chin.comli.com/test.html" rel="nofollow">http://chin.comli.com/test.html</a></p>