title: Adding Sound on Button Click Using jQuery
body: <p>So I have a scenario in my text based adventure that I'm trying to add a sound effect to when a certain player choice is made but I'm having trouble adding it.</p>
  
  <pre><code>&lt;html&gt; 
    &lt;div id="s1"&gt;
      &lt;div class="sit_2"&gt;
        You  stumble upon a dark cave. Do you go inside or not?               
      &lt;/div&gt;
      &lt;div class="sit_3a"&gt;
        A hungry bear comes and kills you.
      &lt;/div&gt;
    &lt;/div&gt;
  
    &lt;div id="q1"&gt;
      &lt;input type="button" class="choice_2a" value="Go inside"&gt;
      &lt;input type="button" class="choice_2b" value="Don't go inside"&gt;
    &lt;/div&gt;
    &lt;audio id="bear" preload="auto" src ="audio/bear.mp3"&gt;&lt;/audio&gt;    
  &lt;/html&gt;
  
  
  &lt;javascript type="text/javascript"&gt;
    $(document).ready(function(){
      $(".choice_2a").click(function(){
        $(".sit_2, .choice_2a, .choice_2b").hide();
        $("#cave").fadeOut(3000);
        $(".sit_3a").fadeIn(3000);
        $("#bear").play();
      });
    )}
  &lt;/javascript&gt;
  </code></pre>
  
  <p>So what I'm trying to do is play #bear when .choice_2a is selected using jQuery.</p>