title: jQuery hasAttr checking to see if there is an attribute on an element
body: <p>How do you check if there is an attribute on an element in jQuery? Similar to <code>hasClass</code>, but with <code>attr</code>?</p>
  
  <p>For example, </p>
  
  <pre><code>if ($(this).hasAttr("name")) {
      // ...
  }
  </code></pre>