random word shortcode

This commit is contained in:
zoe 2022-04-16 22:01:53 +02:00
parent 26372fdcca
commit d267fc4356
10 changed files with 91 additions and 3 deletions

21
\ Normal file
View file

@ -0,0 +1,21 @@
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() {}