-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathaulajs09.html
More file actions
32 lines (32 loc) · 924 Bytes
/
Copy pathaulajs09.html
File metadata and controls
32 lines (32 loc) · 924 Bytes
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
<!DOCTYPE html>
<html>
<head>
<title>JavaScript Aula 09</title>
<script>
function verde() {
var cx = document.getElementById("caixa");
cx.style.backgroundColor = "green";
cx.innerHTML = "Verde";
}
function vermelho() {
var cx = document.getElementById("caixa");
cx.style.backgroundColor = "red";
cx.innerHTML = "Vermelho";
}
</script>
</head>
<body>
<h1>JavaScript Aula 09</h1>
<h2>style</h2>
<button onclick="verde();">Verde</button>
<button onclick="vermelho();">Vermelho</button>
<p id="caixa" style="width: 100px; height: 100px; background-color: aqua">
Caixa 1
</p>
<p id="caixa">
Caixa 2
</p>
<hr>
<p>Vai Corinthians!!</p>
</body>
</html>