title: Using jQuery to get data attribute values with .each()
body: <p>I have the following HTML with data attributes - I want to write some jQuery that will loop through the HTML and collect the data attributes and put them into an array - could anyone assist as I'm getting an error.</p>
  
  <pre><code>ERROR in console log : item.data is not a function
  </code></pre>
  
  <p>I am trying to use the data() attribute - can you see what I'm doing wrong?</p>
  
  <p>// My HTML code</p>
  
  <pre><code>&lt;span class="winners" data-userid="123" data-position="1" data-fullname="neil"&gt;
  &lt;span class="winners" data-userid="234" data-position="2" data-fullname="Ron"&gt;
  &lt;span class="winners" data-userid="421" data-position="3" data-fullname="Philip"&gt;
  </code></pre>
  
  <p>// My jQuery code</p>
  
  <pre><code>var multi = $('.winners');
  var winners_array = [];
  
  $.each(multi, function (index, item) {
      winners_array.push( {name: 'fullname', value: item.data('fullname')} );  
  });
  
  console.log(winners_array);
  // ERROR in console log : item.data is not a function
  </code></pre>