-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
37 lines (30 loc) · 1.04 KB
/
index.html
File metadata and controls
37 lines (30 loc) · 1.04 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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>testejavascript</title>
<link href="style.css" rel="stylesheet" type="text/css" />
<script>
function interruptor ()
{
var imagemLigada = "https://i.pinimg.com/originals/12/df/2e/12df2ead7c871a16ae2ab11f3e746c2c.png"
if (document.getElementById("luz").src == imagemLigada)
{
var imagemDesligada= "https://3.bp.blogspot.com/-Zg1fMVnsc9c/TvokUpUGINI/AAAAAAAAANM/9kcWGv_1-Fc/s1600/L%25C3%2582MPADA.jpg"
document.getElementById("luz").src =imagemDesligada;
}
else {
document.getElementById("luz").src =imagemLigada;
}
}
</script>
</head>
<body>
<h1>Acenda a lampada</h1>
<img src="https://3.bp.blogspot.com/-Zg1fMVnsc9c/TvokUpUGINI/AAAAAAAAANM/9kcWGv_1-Fc/s1600/L%25C3%2582MPADA.jpg" width="30%" id="luz" />
<button onclick="interruptor ()">
on/off
</button>
</body>
</html>