hugo-battheme/\
2022-04-16 22:01:53 +02:00

21 lines
486 B
Text

const buttons = document.getElementsByClassName("randomword-button");
export function randomizeWords() {
registerButtons();
}
function registerButtons() {
for (let button of buttons) {
button.addEventListener("click", function () {
button.innerHTML = processWordlist(button.getAttribute("data-wordlist"));
});
button.click();
}
}
// takes all the words and returns only one
function processWordlist(wordlist) {
return wordlist;
}
function stripSpaces() {}