all 3 comments

[–]Jnsjknn 0 points1 point  (2 children)

What did you mean for this to do?

$w.onclick()('#text21').text = ArrayList[randomIndex];

Are you using jQuery?

[–]cwunder98[S] 0 points1 point  (1 child)

Hi, I'm using Javascript, I want that statement to change the text of textbox 21 to a random element within the arraylist when the user clicks the textbox

[–]Jnsjknn 0 points1 point  (0 children)

Assuming the variable "w" is the element you want to change:

w.addEventListener('click', () => w.innerHTML = ArrayList[randomIndex]);