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 JavaScript Basics Making Decisions in Your Code with Conditional Statements The Conditional Challenge Solution

Kara Caputo
Kara Caputo
2,213 Points

The JS code is performing correctly but I cannot get the HTML text to show on the page at the end.

To test that the JS code was working, I switched everything to console.log. It all appears in the console and ranks properly at the end. I copied the code for part 3 (Select the <main> HTML element) and 6 (Output results to the <main> element) exactly but I cannot get the HTML to appear on the page at the end. My code reads the following for each respective part.

// 3.

const main = document.querySelector('main');

// 6.

main.innerHTLM = `
  <h2>You got ${correct} out of 5 questions correct.</h2>
  <p>Crown earned: <strong>${rank}</strong></p>
`;

1 Answer

Ally Sparham
Ally Sparham
9,753 Points

Hiya

I'm not sure if it's a slight typo here - you have innerHTLM instead of innerHTML in the snippet for part 6.

Ally