title: Jquery Get Class of Clicked DIV inside DIV
body: <p>I am trying to figure out what button a user has clicked inside a DIV container, but I must be doing something wrong here. I keep getting a no attributes error. Can anyone tell me if I am doing something wrong? Here is my JS:</p>
  
  <pre><code>// Bind ButtonClicks
  $('#jplayers .button').on("click",function(e){
      alert("Class :" + e.attr("class"));
      // Determin what button
      if(  e.attr("class").indexOf("play") &gt; 0 ){
          // Play Clicked
          player.jPlayer("play");
      }else{
          // Pause Clicked
          player.jPlayer("pause");
      }
  }); 
  </code></pre>
  
  <p>Here is my HTML:</p>
  
  <pre><code>    &lt;div id="jplayers"&gt;
          &lt;!--First Player--&gt;
          &lt;div id="zen_1"&gt;
              &lt;span class="player"&gt;&lt;/span&gt;
              &lt;span class="circle"&gt;&lt;/span&gt;
              &lt;span class="progress"&gt;&lt;/span&gt;
              &lt;span class="buffer"&gt;&lt;/span&gt;
              &lt;span class="drag"&gt;&lt;/span&gt;
              &lt;div class="button"&gt;
                  &lt;span class="icon play"&gt;&lt;/span&gt;
                  &lt;span class="icon pause"&gt;&lt;/span&gt;
              &lt;/div&gt;
          &lt;/div&gt;
          &lt;!--Second Player--&gt;
          &lt;div id="zen_2"&gt;
              &lt;span class="player"&gt;&lt;/span&gt;
              &lt;span class="circle"&gt;&lt;/span&gt;
              &lt;span class="progress"&gt;&lt;/span&gt;
              &lt;span class="buffer"&gt;&lt;/span&gt;
              &lt;span class="drag"&gt;&lt;/span&gt;
              &lt;div class="button"&gt;
                  &lt;span class="icon play"&gt;&lt;/span&gt;
                  &lt;span class="icon pause"&gt;&lt;/span&gt;
              &lt;/div&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  </code></pre>
  
  <p>Thanks for any help</p>