title: Play audio and restart it onclick
body: <p>I'm looking to restart an audio file in a HTML5 audio player. I have defined a audio file and a <code>play</code> button.</p>
  
  <pre><code>&lt;audio id="audio1" src="01.wav"&gt;&lt;/audio&gt;
  &lt;button onClick="play()"&gt;Play&lt;/button&gt;
  </code></pre>
  
  <p>When I click the <code>play</code> button the audio file starts playing, but when I click the button again the audio file doesn't stop and will not play again until it reaches the end of the file.</p>
  
  <pre><code>function play() {
      document.getElementById('audio1').play();
  }
  </code></pre>
  
  <p>Is there a method that would allow me to restart the audio file when I click the button using <code>onclick</code> rather than waiting for the song to stop?</p>