media_array - is collection of dom elements and not jQuery objects, attr() - is a jQuery object function you need to "convert" media_array[0] first if you want to use attr()
It is in the ready jquery function and the array.legnth is returning 10 (that is the correct number of divs with class .media). Therefore that appears to work... however it wont select the attr from the array.