title: Getting "play() failed because the user didn't interact with the document first" error when trying to play sound (javascript/html)
body: <p>I'm trying to play a sound on a web page using javascript but whenever I do, I get the above error. Here's my code:</p>
  
  <pre><code>if (thing.startsWith("0")) {
      var a = new Audio("audio.mp4");
      a.play();
  }
  </code></pre>
  
  <p>Furthermore, if you open the console, the sound automatically starts playing.</p>