-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjava1.js
More file actions
46 lines (41 loc) · 1.11 KB
/
Copy pathjava1.js
File metadata and controls
46 lines (41 loc) · 1.11 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
38
39
40
41
42
43
44
45
46
window.addEventListener('DOMContentLoaded', arrow, false);
function arrow () {
alert ('Page loaded successfully. Now Initiating test 1: Buttons');
var buttons = document.getElementByTagName("button")
buttons [0].addEventListener('click', cat, false)
buttons [1].addEventListener('click', dog, false)
buttons [2].addEventListener('click', joke, false)
buttons [3].addEventListener('click', fact, false)
}
function showCat() {
var x = document.getElementById("cat");
if (x.style.display === "none") {
x.style.display = "block";
} else {
x.style.display = "none";
}
}
function showDog() {
var x = document.getElementById("dog");
if (x.style.display === "none") {
x.style.display = "block";
} else {
x.style.display = "none";
}
}
function showText() {
var x = document.getElementById("joke");
if (x.style.display === "none") {
x.style.display = "block";
} else {
x.style.display = "none";
}
}
function fact() {
var x = document.getElementById("smart");
if (x.style.display === "none") {
x.style.display = "block";
} else {
x.style.display = "none";
}
}