title: Check if data attribute exists without a value
body: <p>My goal is to add some jQuery to a project that will check to see if an element has a <code>data-attribute</code> without a value. For instance, with the <code>video</code> tag you can just add <code>autoplay</code> without a value and it will autoplay. I am attempting to do the same thing and wondering if it is possible. Here's what I tried, but it's returning false currently:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>$(function() {
    $('div').click(function() {
      if ($(this).attr('data-specs')) {
        console.log('has specs');
      } else {
        console.log('no specs');
      }
    });
  });</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"&gt;&lt;/script&gt;
  &lt;div data-specs&gt;Specs&lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>