title: Javascript Get data-type tag value
body: <p>I would like to be able to retrieve the <code>data-type</code>, which is a new HTML5 tag name (or any custom tag name for that matter) with pure javascript. The context in which I would need to access this data is from within a loop of an elements childNodes.</p>
  
  <pre><code>var children = document.getElementById('foo').childNodes;
  for(var i=0; i&lt;children.length; i++) {
      var dataType = children[i].dataType //This does not work.
  }
  </code></pre>
  
  <p>Is there some way to prototype <code>childNodes</code> so that any element retrieved with that tag will have a <code>dataType</code> function attached to it so that the above code would in fact work?</p>
  
  <p>I figure I'll have to use <code>children[i].outerHTML</code> to get the element's raw HTML and then a regular expression to actually put the value from the element.</p>