百度去! <p/> let str = getElementsByTagName("p") for ( var i=0;i<str.length;i++ ) { str [i].style.backgroundColor = "red"; }