JQuery On Click with data attribute
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/2487747/selecting-element-by-data-attribute">Selecting element by data attribute</a>  </p>
</blockquote>



<p>I'm trying to listen to when an element with a certain data attribute is clicked but I can't seem to get the on click working and I'm sure its something easy on my part that I'm missing. I have</p>

<pre><code>&lt;a href="/home" data-spinner="true" /&gt;
</code></pre>



<pre><code>$.data('record').click(function() {
         //Do Action
});
</code></pre>

<p>I have that with variations. My question is, how can I use an data attribute with on click?</p>
