title: Javascript array from all elements with a certain class name
body: <p>I am trying to make an array from elements with a certain class in my web page. The array should get the videofile attribute value from all a tags with the class  videoLink.</p>
  
  <p>The final values in the array should be.</p>
  
  <pre><code> cycling_large, ocean_medium, winecountry_part1
  
  
  
   &lt;a class="videoLink"  videofile="cycling_large"  &gt;&lt;/a&gt;
   &lt;a class="videoLink" videofile="ocean_medium" &gt;&lt;/a&gt;
   &lt;a class="videoLink" videofile="winecountry_part1" &gt;&lt;/a&gt;
  </code></pre>
  
  <p>I tried this but, does not work.</p>
  
  <pre><code>var values = $('.videoLink').map(function() { return this.attr('videofile'); }).get();
  </code></pre>
  
  <p>Thanks in advance.</p>