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,752 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