Closed ArmaniH closed 9 years ago
I'm sorry for the delay in responding, Armani! I'm checking it out now.
Can you tell me what's going on here:
$('p').replaceWith($('id', triviaQuestions[0]));
A $
should only go around a CSS selector, and 'id', triviaQuestions[0]
doesn't look like a selector!
That $ defintiely wasn't helping me out. Removed!
Still not pulling from the array and when I tried to console.log the '.' in console.log is causing an error.
Wat. Can you show me the text of the error, and the line that contains the problematic console log?
That's because you put a csonole.log
inside your object, and you can't really do that. You have to put it outside the object. It's similar to how this wouldn't work:
"My name is " + console.log("hello") + "Joe."
That makes perfect sense!
The triviaQuestions array is coming back as undefined
Can you copy and paste from where you set triviaQuestions
to the console.log
?
You're trying to console.log
nothing! Put something in those parentheses. :)
For the trivia, I'm trying to get a question from my array to appear on screen when the user clicks to begin. The click event is working to display text, but I can't figure out how to get one of the questions to appear instead of just some placeholder text in
<p>
.My array
My HTML for