I'm trying to code in HTML/JS for the first time, my goal is to create a script that picks random words out of a list, and I think I'm on a good path. The problem that I can't solve is that I could not find a way to change the script output size, I just need it a lot bigger.
<html>
<button onclick="randomizeFunction()">NUOVA PAROLA</button>
<p>La parola è:</p>
<p id="randomWord"></p>
</html>
<script>
const myList = ["test1","test2","test3"];
randomizeFunction()
function randomizeFunction() {
document.getElementById("randomWord").innerHTML = myList[Math.floor(Math.random() * myList.length)]
}
</script>
I've been able only to set the font to italics
<html>
<button onclick="randomizeFunction()">NUOVA PAROLA</button>
<p>La parola è:</p>
<p id="randomWord"></p>
</html>
<script>
document.body.style.fontStyle = "italic"
const myList = ["test1","test2","test3"];
randomizeFunction()
function randomizeFunction() {
document.getElementById("randomWord").innerHTML = myList[Math.floor(Math.random() * myList.length)]
}
</script>
Can anybody help? Thanks in advance, Luca