mirror of
https://git.kittycat.homes/zoe/hugo-battheme.git
synced 2024-08-15 03:25:18 +00:00
22 lines
486 B
Text
22 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() {}
|