added hint, fixed typos, updated formatting (#33492)
* added hint, fixed typos, updated formatting * fix: fixed typo
This commit is contained in:
committed by
Randell Dawson
parent
72a23586c6
commit
eef0d1e811
@ -3,14 +3,19 @@ title: Render HTML Elements to the DOM
|
|||||||
---
|
---
|
||||||
# Render HTML Elements to the DOM
|
# Render HTML Elements to the DOM
|
||||||
|
|
||||||
To render an element to the DOm, we use the following syntax
|
To render an element to the DOM, we use the following syntax
|
||||||
````javascript
|
````javascript
|
||||||
ReactDOM.render(<item to be rendered>, <where to be rendered>);
|
ReactDOM.render(<item to be rendered>, <where to be rendered>);
|
||||||
````
|
````
|
||||||
|
Use the Document method `getElementByID()` to target a specfic node in the DOM
|
||||||
|
````javascript
|
||||||
|
document.getElementByID(<target node>)
|
||||||
|
````
|
||||||
|
Use the Document method `getElementByID()` as an argument within the ReactDOM method `render()` to solve this challenge.
|
||||||
|
|
||||||
## Solution
|
## Solution
|
||||||
|
|
||||||
Following the syntax, we would add this line of code to render the JSX element to the div with the id of challenge-node.
|
Following the syntax, we would add this line of code to render the JSX element to the `div` with the id of challenge-node.
|
||||||
````javascript
|
````javascript
|
||||||
ReactDOM.render(JSX,document.getElementById('challenge-node'));
|
ReactDOM.render(JSX,document.getElementById('challenge-node'));
|
||||||
````
|
````
|
||||||
|
Reference in New Issue
Block a user