-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathex05.html
More file actions
44 lines (38 loc) · 1.26 KB
/
ex05.html
File metadata and controls
44 lines (38 loc) · 1.26 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
43
44
<!DOCTYPE html>
<html lang="pt-BR">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
body{
background-color: rgb(68,125, 199);
color: #fff;
font: normal 18pt Arial;
}
</style>
</head>
<body>
<h1>Iniciando estudo com dom</h1>
<p>Aqui vai o resultado </p>
<p>Aprendendo a usar o <strong> DOM </strong> em Javascrit.</p>
<div id= 'msg'> Clique em mim </div>
<script>
var p1 = window.document.getElementsByTagName ('p') [1]
window.document.write('Está escrito assim: ' + p1.innerHTML)
/* var d = window.document.getElementsById('msg')
d.innerText = 'ola mundo'
d.style.background= 'blue'*/
/*var d = window.document.getElementsByClass('msg')
d.innerText = 'ola mundo'
d.style.background= 'blue'*/
/*var d = window.document.getElementsByName('msg') [0]
d.innerText = 'ola mundo'
d.style.background= 'blue'*/
var d = window.document.querySelector('div#msg')
d.innerText = 'ola mundo'
d.style.background= 'blue'
</script>
</body>
</html>