📜  javascript dom 方法列表 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:04:03.339000             🧑  作者: Mango

代码示例1
var myLinkCollection = document.getElementsByTagName(“abc”);
for (i = 0; i < myLinkCollection.length; i++) {
    if (myLinkCollection[i].className == “std_class”) {
        myLinkCollection[i].onclick = function() {
            this.style.backgroundColor = “#f00”;
        }
    }
}