var getElementsByName = function(tag, name){
var returns = document.getElementsByName(name);
if(returns.length > 0) return returns;
returns = new Array();
var e = document.getElementsByTagName(tag);
for(var i = 0; i < e.length; i++){
if(e[i].getAttribute("name") == name){
returns[returns.length] = e[i];
}
}
return returns;
}
alert(getElementsByName('span', 'currentPrice').length);
var returns = document.getElementsByName(name);
if(returns.length > 0) return returns;
returns = new Array();
var e = document.getElementsByTagName(tag);
for(var i = 0; i < e.length; i++){
if(e[i].getAttribute("name") == name){
returns[returns.length] = e[i];
}
}
return returns;
}
alert(getElementsByName('span', 'currentPrice').length);