title: How can I get the ID, class or HTML tag of an element that calls my function?
body: <p>I've been trying to use <code>jQuery.fn.extend()</code> and it's been working but I want to get the ID, class or html tag that called it. I can't know whether the string calling my <code>fn</code> is a tag, ID or class.</p>
  
  <p>For example,</p>
  
  <blockquote>
    <p>$('table').scrollify();</p>
  </blockquote>
  
  <p>I want to be able to get the string <code>'table'</code> not <code>this</code> inside my <code>scrollify</code> function</p>
  
  <p><strong><em>Here's my code:</em></strong></p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>(function($) {
    $.fn.scrollify = function() {
      $('tbody').css({
        'width': Math.ceil($('thead').width() + 17)
      });
      $('tbody &gt; tr &gt; td').css({
        'width': Math.ceil($('thead').width())
      });
      $('thead &gt; tr &gt; th').css({
        'width': $('tbody').width() / $('thead &gt; tr &gt; th').length
      });
      $('tbody').css({
        'margin-top': $('thead').height() - 1
      });
      return this.get(0).scrollHeight &gt; this.height();
    };
  })(jQuery);
  
  $('table').scrollify();</code></pre>
  </div>
  </div>
  </p>