title: Create audio element dynamically with createElement instead of getElementById
body: <p>I have a bit of javascript which runs like this:</p>
  
  <pre><code>document.getElementById("audio").innerHTML = ("&lt;audio id=\"player\" src=\"data:audio/x-wav;base64,"+encode64(wav)+"\"&gt;");
  return document.getElementById("player");
  </code></pre>
  
  <p>I would like to change it to something like this:</p>
  
  <pre><code>audio = document.createElement("audio");
  audio.src = "data:audio/x-wav;base64,"+encode64(wav)+"\"&gt;";
  document.body.appendChild(audio);
  return audio;
  </code></pre>
  
  <p>But, this does not work in the same way. Why is this not essentially equivalent in returning an element with a <code>play</code> method?</p>