简体   繁体   中英

change innerHTML with text on squarespace

i'm trying to take "sold out" on this page and change it to "coming soon."

right now i have the following but it's not working.

window.onload = function() {
  document.getElementsByClassName("product-mark sold-out").innerHTML = "Coming Soon";
};
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";
        }

}

That should take care of it!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM