title: How to play a sound on a checkbox in html css
body: <pre><code>&lt;audio id=&quot;myaudio&quot; src=&quot;img/toggle.mp3&quot; &gt;&lt;/audio&gt;
  
  &lt;div class=&quot;buttonpos&quot;&gt;
      &lt;input class=&quot;toggle&quot; onchange=&quot;myfunction&quot; type=&quot;checkbox&quot; id=&quot;switch&quot;&gt;
      &lt;label onchange=&quot;document.getElementById('myaudio').play();&quot; for=&quot;switch&quot; class=&quot;switchLabel&quot;&gt;
          &lt;span class=&quot;switchLabelBg&quot;&gt;&lt;/span&gt;
      &lt;/label&gt;
  &lt;/div&gt;
  </code></pre>
  <p>Why does this not work? I am trying to make a sound play when i click on my checkbox!</p>