-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbulb.html
More file actions
37 lines (26 loc) · 1.33 KB
/
bulb.html
File metadata and controls
37 lines (26 loc) · 1.33 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 http-equiv="X-UA-Compatible" content="IE=edge">
<title>JavaScript</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="">
</head>
<body>
<h2 id="HD">What Can JavaScript Do?</h2>
<p>JavaScript can change HTML attribute values.</p>
<p>In this case JavaScript changes the value of the src (source) attribute of an image.</p>
<button onclick="document.getElementById('myImage').src='pic_bulbon.gif'">Turn on the light</button>
<img id="myImage" src="pic_bulboff.gif" style="width:100px">
<button onclick="document.getElementById('myImage').src='pic_bulboff.gif'">Turn off the light</button>
<br><br>
<button onclick="document.getElementById('HD').style.fontSize='35px'">Increase Font Size</button>
<br><br>
<button onclick="document.getElementById('HD').style.fontSize=''">Resert Font Size</button>
<button onclick="document.getElementById('HD').style.display='none'">Hide Style</button>
<button onclick="document.getElementById('HD').style.display='block'">Show Style</button>
<script src="" async defer></script>
</body>
</html>