let li_elements = document.getElementsByTagName("li") for (let i = 0; i < li_elements.length; i++){ if (li_elements[i].textContent.includes("SALE")){ console.log(li_elements[i].childNodes[0]) li_elements[i].childNodes[0].style.color = "red"; } } window.onload = function(e){ let elements = document.getElementsByClassName("cmp-product-thumb") $(".category-item-placeholder").css("min-height", elements[0].offsetHeight) let elems = document.getElementsByClassName("colorrechteck"); console.log(elems) for (let i_1 = 0; i_1 < elems.length; i_1++){ let allclasses = elems[i_1].className.split(" ") console.log(allclasses) for (let i1= 0; i1 < allclasses.length; i1++){ if (allclasses[i1].includes("rechteck-")){ let sp = allclasses[i1].split("-"); //elems[i_1].children[0].children[1].insertAdjacentHTML("beforeend", '') elems[i_1].children[0].children[1].insertAdjacentHTML("beforeend", `
`) elems[i_1].children[0].children[1].children[0].children[0].innerHTML = " " elems[i_1].style.backgroundColor= "#"+sp[1]; elems[i_1].style.padding= "10px" } } } } if (elemdesktop){ elemdesktop.parentElement.parentElement.style.display = "none"; categorydiv.style.flex = "0 0 100%"; $(categorydiv).css("max-width", "100%"); }