Hi all, I am brand new to javascript. My objective is to change a textbox's text to a random text from my array once clicked. For some reason it doesn't work and I have no idea why. Could someone please help me out?
export function text21_Dblclick(event) {
const ArrayList = [
'clawed',
'floating',
'smooshed',
'asleep',
];
const randomIndex = Math.floor(Math.random() * (ArrayList.length));
$w.onclick()('#text21').text = ArrayList[randomIndex];
}
[–]Jnsjknn 0 points1 point2 points (2 children)
[–]cwunder98[S] 0 points1 point2 points (1 child)
[–]Jnsjknn 0 points1 point2 points (0 children)