forked from danielscarvalho/FTT-JavaScript
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaulajs09.html
More file actions
29 lines (29 loc) · 862 Bytes
/
Copy pathaulajs09.html
File metadata and controls
29 lines (29 loc) · 862 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
<!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">
</p>
<p id="caixa">
Caixa 2
</p>
</body>
</html>