Challenge-node is not defined

Tell us what’s happening:
I can’t complete the challenge 'cause it keeps saying that the challenge-node is not defined and I don’t know how to fix it. (I don’t use extensions that might interfere on it)

  **Your code so far**

const JSX = (
<div>
  <h1>Hello World</h1>
  <p>Lets render this to the DOM</p>
</div>
);
// Change code below this line
ReactDOM.render(JSX, document.getElementById(id="challenge-node"))
  **Your browser information:**

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.74 Safari/537.36

Challenge: Render HTML Elements to the DOM

Link to the challenge:

this is not the way to use getElementById. The argument it takes is a string, and it returns the element.

1 Like

Look closely.
In the part of

ReactDOM.render(JSX, document.getElementById());

You code inside a id="challenge-node" that is a html way, but you need to render the JSX as javascript it would do, you have to write.

ReactDOM.render(JSX,document.getElementById('challenge-node'))

without the Id

2 Likes

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.