Why can I not access the data attribute of an element with jQuery.
<p>I have the following HTML:</p>

<pre><code>    &lt;div  class="button disabled dialogLink"
        id="edit"  
        data-action="Edit" &gt;
        &lt;div class="sprite-blank" &gt;&lt;/div&gt;
    &lt;/div&gt;
</code></pre>

<p>This javascript</p>

<pre><code>$('.dialogLink')
    .click(function () {
        adminDialog(this);
        return false;
    });


function adminDialog($link) {
    "use strict";
        link = {
            action: $link.data('action') || ''
</code></pre>

<p>I get an error saying </p>

<pre><code>Uncaught TypeError: Object #&lt;HTMLDivElement&gt; has no method 'data'
</code></pre>

<p>Does anyone have an idea what I am doing wrong. It seems very simple code so I can't understand what's wrong.</p>
