I am trying to make a game for my two girls. It randomly selects an adjective and a noun, then displays the words for them to act out.
I can get the random words to print to the console, but now I need them to appear in the html.
Array.prototype.sample = function(){
return this[Math.floor(Math.random()*this.length)];
}
var randomAdj = (["happy", "sad", "bouncy", "silly"].sample());
var randNoun = (["monkey", "butterfly", "puppy"].sample());
document.getElementById(#adj).textContent = randomAdj;
document.getElementById(#noun).textContent = randomNoun;
The last two lines aren't working for me (#adj and #noun are span ids used in the html).
I am only a couple of weeks into learning, so I might be missing something super obvious here.