title: Play random sound on image click in Wordpress site?
body: <p>Okay, so I've been researching this for a couple hours and at this point I'm probably just confusing myself more. ;)</p>
  <p>I read the answers to this question over here: <a href="https://stackoverflow.com/questions/11039984/how-can-i-play-a-random-sound-on-click-in-a-web-page/11040096#11040096">How can I play a random sound on click in a web page?</a></p>
  <p>I also read the source code earlier that that author is originally referencing.</p>
  <p>I've added this code between the  tags in the header.php file on my Wordpress site:</p>
  <pre><code> &lt;script type=&quot;text/javascript&quot; src=&quot;http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js&quot;&gt;&lt;/script&gt;
  &lt;script&gt;
  function playSounds() {
    var sounds = new Array(
      &quot;http://www.namechanged.com/laughs/laugh1.wav&quot;,
      &quot;http://www.namechanged.com/laughs/laugh2.wav&quot;,
      &quot;http://www.namechanged.com/laughs/laugh3.wav&quot;,
      &quot;http://www.namechanged.com/laughs/laugh4.wav&quot;
     );
  
  $(&quot;#element&quot;).html(&quot;&lt;embed src=\&quot;&quot;+sounds[Math.floor(Math.random()*(sounds.length+1))]+&quot;\&quot; hidden=\&quot;true\&quot; autostart=\&quot;true\&quot; /&gt;&quot;);
  }
  &lt;/script&gt;
  </code></pre>
  <p>and then I added this to my body tag:</p>
  <pre><code>onload=&quot;javascript:playSound()&quot;
  </code></pre>
  <p>and this between my body tags:</p>
  <pre><code>&lt;div id=&quot;element&quot;&gt;
  &lt;button onclick=&quot;playSound()&quot;&gt;LAUGH&lt;/button&gt;
  &lt;/div&gt;
  </code></pre>
  <p>I KNOW I'm missing something painfully obvious, but I think I've been looking at this for too long to ever see what it is. Help?</p>