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.
The final values in the array should be.
cycling_large, ocean_medium, winecountry_part1
<a class="videoLink" videofile="cycling_large" ></a>
<a class="videoLink" videofile="ocean_medium" ></a>
<a class="videoLink" videofile="winecountry_part1" ></a>
I tried this but, does not work.
var values = $('.videoLink').map(function() { return this.attr('videofile'); }).get();
Thanks in advance.
videofile? I think you meandata-videofile...:P