title: Play sound with javascript
body: <p>I want to create a table with string and button(that play sound) in each row and every button play a different sound.</p>
  
  <p>i want to do it with this method :</p>
  
  <pre><code>&lt;script&gt;
  function EvalSound(soundobj) {
    var thissound=document.getElementById(soundobj);
    thissound.Play();
  }
  &lt;/script&gt;
  
  &lt;embed src="success.wav" autostart=false width=1 height=1 id="sound1"
  enablejavascript="true"&gt;
  </code></pre>
  
  <p></p>
  
  <p>and this is the button:</p>
  
  <pre><code>&lt;form&gt;
  &lt;input type="button" value="Play Sound" onClick="EvalSound('sound1')"&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>the problem is that i want here :</p>
  
  <pre><code>&lt;input type="button" value="Play Sound" onClick="EvalSound('sound1')"&gt;
  </code></pre>
  
  <p>to write the file URL instead of 'sound1', it is possible to do it in this way? or i need to change another stuff in the code?</p>
  
  <h1>Edit :</h1>
  
  <p>i build the script like this:</p>
  
  <pre><code>&lt;script&gt;
     function EvalSound(soundobj) {
     var embed = document.createElement('embed');
     embed.setAttribute('width',1);
     embed.setAttribute('height',1);
     embed.setAttribute('src',soundobj);
     embed.setAttribute('autostart', false);
     embed.setAttribute('enablejavascript', true);
     embed.Play();
     }
  &lt;/script&gt;
  </code></pre>
  
  <p>and call this with :</p>
  
  <pre><code>&lt;form&gt;
      &lt;input type="button" value="Play Sound" onClick="EvalSound('sound url')"&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>and it still not play the sound.</p>