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