-
Notifications
You must be signed in to change notification settings - Fork 734
/
Copy path09-dom.html
35 lines (29 loc) · 814 Bytes
/
09-dom.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
30
31
32
33
34
35
<!DOCTYPE html>
<html>
<head>
<title>DOM</title>
</head>
<body>
<button>hello</button>
<button class="js-button">Second button</button>
<script>
console.log(document.querySelector('button').innerHTML);
document.querySelector('button')
.innerHTML = 'Changed';
const buttonElement = document.querySelector('.js-button');
console.log(buttonElement);
/*
console.log(document.title);
document.title = 'Changed';
console.log(document.body);
console.log(typeof document.body);
console.log(document.body.innerHTML);
document.body.innerHTML = '<button>Good job!</button>';
*/
/*
document.body.innerHTML = 'hello';
document.title = 'Good job!';
*/
</script>
</body>
</html>