📅  最后修改于: 2022-03-11 15:01:55.062000             🧑  作者: Mango
var spans = document.getElementsByTagName("span");
for (var i = 0; i < spans.length; i++) {
if (spans[i].className == 'xyz') {
spans[i].style.backgroundColor = '#000';
}
}