Closed ArmaniH closed 9 years ago
One problem is this:
$(this).append(['<p>How tall am I?</p>']);
I'm not sure why that's in array brackets?
I think you're making things a little over-complicated. This portion:
$('p').replaceWith(function(triviaQuestions) {
return $(this).append(['<p>How tall am I?</p>']); //<-this line I added to text if a hardcoded string would appear and it did. Without it the space is just blank
});
...can be rewritten like this:
$('p').replaceWith('<p>How tall am I?</p>');
That and some syntax altering took care of it! Thank you!
I tried adding an array to a function. I expected it to populate an element on a click event . Nothing happens instead. I tried using hard coded text to do the same thing and it worked fine, but I need a value from an array to do the same thing. Ultimaely being that a random value from the array will be called with each click event. I'm workign on the trivia project.