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 Treehouse Club - MASH MASH - JavaScript Stuff You Can Change

Hi, I managed to add another question in the html and css. But I can get it to work in the javascript

I think I broke the code because the answers box doesn't come up anymore. Would you take a look at my code and tell me what's wrong? https://w.trhou.se/kmpuas47m5 Thanks

1 Answer

Nichole Pellow
Nichole Pellow
8,206 Points

I know you asked this a while ago, but in case you never figured it out...

Under the fill_in_answers function, you put:

function fill_in_answers(answers) {
    // Find the spans that need filled
    var home = document.querySelector('#home');  // This says make a new variable and find the HTML tag that has the ID of "home" 
    var profession = document.querySelector('#profession');
    var pet = document.querySelector('#pet');
    var location = document.querySelector('#location');
    var name = document.querySelector('#luck');

Where it says var name, it should be var luck.

Also, I noticed on your JS file that under the mash options where you put different planets that you changed the random number to 5, but only have 4 planets listed. You should add a 5th planet as well :)

Hope that helps!