0

我正在尝试在此页面上删除“已售罄”并将其更改为“即将推出”。

现在我有以下但它不工作。

window.onload = function() {
  document.getElementsByClassName("product-mark sold-out").innerHTML = "Coming Soon";
};
4

1 回答 1

2
window.onload = function(){
     //this captures all the elements with the spec classes
     var soldItems = document.getElementsByClassName('product-mark sold-out');

     //this changes each element 1 by 1 to new text
        for(var i=0; i<soldItems.length; i++){
           soldItems[i].innerHTML = "Coming Soon";
        }

}

那应该照顾它!

于 2014-09-21T01:29:36.410 回答