title: Playing a sound in safari
body: <p>I am trying to play a sound in Safari on a special event.
  This is what I am doing</p>
  
  <pre><code>&lt;html&gt;
      &lt;head&gt;
          &lt;in a js file&gt;
              if(event)
                  document.getElementById('sound').play();
          &lt;/in a js file&gt;
      &lt;/head&gt;
      &lt;body&gt;    
          &lt;audio id="sound" src="pling.mp3"&gt;&lt;/audio&gt; 
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>The sound pling.mp3 is in the the same folder as the html file.</p>
  
  <p>The result in Safari developer console is:
  TypeError: Result of expression 'document.getElementById('sound').play' [undefined] is not a function.</p>
  
  <p>What am I doing wrong?
  Isn't this the way it is supposed to work?</p>