-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
29 lines (22 loc) · 900 Bytes
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<div id="root">
</div>
</body>
<script crossorigin src="https://unpkg.com/react@18/umd/react.development.js"></script>
<script crossorigin src="https://unpkg.com/react-dom@18/umd/react-dom.development.js"></script>
<script>
// createElement returns an object . The parameters are name of the tag , attributes and children. The object is used by render to paint the DOM with attributes
const parent = React.createElement("div",{id:"parent"},
React.createElement("div",{id:"child"},
[React.createElement("h1",{},"I am a h1 tag"),React.createElement("h2",{},"I am a h2 tag")]))
const root = ReactDOM.createRoot(document.getElementById("root"))
root.render(parent)
</script>
</html>