(Communos created the page CommunosTestPage/script.js using a non-default content model "JavaScript") |
No edit summary |
||
| Line 1: | Line 1: | ||
function addClassToDiv(string) { | |||
const rarityClasses = document.querySelectorAll(".Rarity") | |||
for (const div of rarityClasses) { | |||
if (div.textContent.includes(string)) { | |||
div.classList.add("Rare") | |||
} | |||
} | |||
} | |||
addCkassToDiv("Rare"); | |||
Revision as of 11:24, 22 June 2024
function addClassToDiv(string) {
const rarityClasses = document.querySelectorAll(".Rarity")
for (const div of rarityClasses) {
if (div.textContent.includes(string)) {
div.classList.add("Rare")
}
}
}
addCkassToDiv("Rare");