Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

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
221,297 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.