title: Get data-attributes with jQuery .class selector
body: <p>I want to trigger an onClick event for an entire class of elements. Normally, I would do something like this:</p>
  
  <pre><code>$(".classy").click(function(){
      console.log("Replace this line with something useful!");
  });
  </code></pre>
  
  <p>However, every element of this class has distinct data-attributes that I want to use inside the onClick function. For example:</p>
  
  <pre><code>&lt;div className="classy" data-num={100}&gt;&lt;/div&gt;
  &lt;div className="classy" data-num={931}&gt;&lt;/div&gt;
  &lt;div className="classy" data-num={777}&gt;&lt;/div&gt;
  </code></pre>
  
  <p>On the click of each element, I would want to log the <code>data-num</code> value. Is there any way to do this with jQuery's <code>.click</code>?</p>