Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript Random Quote Generator

Jesus Marco del Carmen
Jesus Marco del Carmen
10,393 Points

[object MouseEvent] text in body.

I am somewhat complete with the random quote generator, but I only have one problem.

Every time I click the button, the next quote that appears has a text above it that says "[object MouseEvent]".

Although, when I refresh the page, it does not show up in the first random quote. Only when I click the button.

2 Answers

Steven Parker
Steven Parker
229,744 Points

Can you share your code? If you are doing an exercise in workspaces, make a snapshot of your workspace and post the link to it.

FYI: Your link can only be used by other Techdegree students.

I know this is an older question, but I had the same thing happen to me when I started on the first project so I wanted to add my solution in case anyone else had the same problem.

Originally I had called the getRandomQuote function outside of the printQuote function and the '[object MouseEvent]' text showed up and the button wasn't responsive anymore.

Once I placed the getRandomQuote function inside the printQuote function, the '[object MouseEvent]' text went away and the button functionality worked again.