title: jQuery loop through HTML5 Data Attributes
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/4187032/get-list-of-data-attributes-using-javascript-jquery">Get list of data-* attributes using javascript / jQuery</a>  </p>
  </blockquote>
  
  
  
  <p>I have a series of objects that all look similar to this:</p>
  
  <pre><code>&lt;a data-type="file" data-path="/some/path" data-size="849858"&gt;Link&lt;/a&gt;
  </code></pre>
  
  <p>I'd like to create a function to pull each of the data attributes dynamically, so if I add something like "data-icon" or any other number of attributes the function still returns an array of all data attributes like:</p>
  
  <pre><code>{
      "type" : "file",
      "path" : "/some/path",
      ...
  }
  </code></pre>