title: Getting the class of the element that fired an event using JQuery
body: <p>is there anyway to get the class when click event is fired. My code as below, it only work for id but not class.</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>$(document).ready(function() {
    $("a").click(function(event) {
      alert(event.target.id + " and " + event.target.class);
    });
  });</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"&gt;&lt;/script&gt;
  &lt;html&gt;
  
  &lt;body&gt;
    &lt;a href="#" id="kana1" class="konbo"&gt;click me 1&lt;/a&gt;
    &lt;a href="#" id="kana2" class="kinta"&gt;click me 2&lt;/a&gt;
  &lt;/body&gt;
  
  &lt;/html&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>jsfiddle code <a href="http://jsfiddle.net/fv3Ca/1/" rel="noreferrer">here</a></p>