-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcreateElementDOM.js
More file actions
44 lines (34 loc) · 1.05 KB
/
Copy pathcreateElementDOM.js
File metadata and controls
44 lines (34 loc) · 1.05 KB
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
30
31
32
33
34
35
36
37
38
39
40
41
42
// // DOM
// const h1DOM = document.createElement("h1")
// h1DOM.title = "Hello";
// h1DOM.className = "heading"
// h1DOM.innerText = "Hello guys!!";
// document.body.appendChild(h1DOM)
// const ulDOM = document.createElement("ul");
// ulDOM.id = 'ul-id'
// ulDOM.style = 'color: red; font-size: 35px'
// const liDOM1 = document.createElement("li");
// liDOM1.innerText = 'Javascript'
// const liDOM2 = document.createElement("li");
// liDOM2.innerText = 'React'
// ulDOM.appendChild(liDOM1)
// ulDOM.appendChild(liDOM2)
// document.body.appendChild(ulDOM)
// //React
// //React.createElement(type, props, chidlren, n)
// const h1React = React.createElement("h1",{
// title: "Hello",
// className: "Heading"
// },'Hello TuanAnh')
// console.dir(h1DOM)
// console.log(h1React)
// const ulReact = React.createElement(
// "ul",
// {
// id: 'ul-id',
// style : 'color: blue; font-size: 50px'
// },
// React.createElement('li',null, 'Javascript'),
// React.createElement('li',null, 'Reactjs')
// )
// console.log(ulReact)