CommunosTestPage/script.js: Difference between revisions

From The First Descendant Wiki
No edit summary
No edit summary
 
Line 1: Line 1:
function addClassToDiv(string) {
function test() {
const rarityClasses = document.querySelectorAll(".Rarity")
const div = document.querySelectorAll("div")
for (const div of rarityClasses) {
div.innerHTML = "Test"
if (div.textContent.includes(string)) {
div.classList.add("Rare")
}
}
}
}


addCkassToDiv("Rare");
test();

Latest revision as of 08:41, 30 June 2024

function test() {
	const div = document.querySelectorAll("div")
	div.innerHTML = "Test"
}

test();