title: Why is .getAttribute returning null for data-* attribute
body: <p>I have some HTML and I'm trying to get the value of "data-nChargers" with this script</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>var noOfChargers = document.getElementById("chargers-list")
                     .getAttribute("nChargers");
  console.log(noOfChargers);</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;div id="chargers-list" data-nChargers="4"&gt;&lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>but it returns null. What am I doing wrong?</p>