title: Object [object HTMLAnchorElement] has no method 'attr'
body: <p>I'm examining a DOM element using console.log. The DOM element is an anchor:</p>
  
  <pre><code> &lt;a href="#" class="videoimage" data-id="ks3H_s3e-Wc"&gt;&lt;/a&gt;
  </code></pre>
  
  <p>When I try to access its id and output it using either of the following lines:</p>
  
  <pre><code>console.log($this.attr(data-id));
  </code></pre>
  
  <p>or</p>
  
  <pre><code>console.log($this.data('id'));
  </code></pre>
  
  <p>I get an error: </p>
  
  <blockquote>
    <p>Object [object HTMLAnchorElement] has no method 'attr'</p>
  </blockquote>
  
  <p>('data' in the second case)</p>
  
  <p>Does an anchor element not have the attr or data methods, or is my mistake something else?</p>