用getElementByTagName("span"):
var trees = document.getElementByTagName("span");
for (var i=0; i<trees.length; i++){
if (trees[i].innerHTML == name){
alert(trees[i].id);
}
}
用getElementByTagName("span"):
var trees = document.getElementByTagName("span");
for (var i=0; i<trees.length; i++){
if (trees[i].innerHTML == name){
alert(trees[i].id);
}
}