Hello. I’m really new to Javascript so please forgive me. I want to add a simple Random Word Generator to my site. I found another post with some code that almost does what I need (included below). I feel like I’m so close to figuring this out and I’ve been banging my head against it for a week. How do I take this code and have it output text from a string to a box on my page each time the button is clicked, rather than loading a link in a new browser window. Thanks so much in advance
const allUrls = [
'google . com',
'facebook . com',
'cnn . com',
'abc . com'
];
$w.onReady(function(){
const randomIndex = Math.floor(Math.random() * (allUrls.length - 1));
$w('#button1').link = allUrls[randomIndex];
});