-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtestejs02.html
More file actions
24 lines (22 loc) · 802 Bytes
/
testejs02.html
File metadata and controls
24 lines (22 loc) · 802 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
<!DOCTYPE html>
<html lang="pt-br">
<head>
<meta charset="UTF-8">
<title>Teste JavaScript</title>
<script>
function acendeLampada() {
document.getElementById("lampada").src = "_imagens/lampada-acesa.jpg";
}
function apagaLampada() {
document.getElementById("lampada").src = "_imagens/lampada-apagada.jpg";
}
function quebraLampada() {
document.getElementById("lampada").src = "_imagens/lampada-quebrada.jpg";
}
</script>
</head>
<body>
<h1>Acenda a lâmpada</h1>
<img src="_imagens/lampada-apagada.jpg" id="lampada" onmouseover="acendeLampada()" onmouseout="apagaLampada()" onclick="quebraLampada()">
</body>
</html>