****edit****
ok the glove has been thrown down…
var elements = (document.getElementsByTagName('li'));
var vals = [];
for(var i=0;typeof(elements[i])!='undefined';vals.push(elements[i++].getAttribute('value')));
no library 3 lines of code…
epicly faster
var myVals = [];
$('li','ul').each(function(){
myVals.push($(this).attr('value'));
});
and using jquery’s map function…
var myVals = [];
$('li','ul').map(function(){
myVals.push($(this).attr('value'));
});
and they are both equally as fast..
http://jsperf.com/testing-stuff