-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhomePage.js
More file actions
27 lines (20 loc) · 796 Bytes
/
homePage.js
File metadata and controls
27 lines (20 loc) · 796 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
var firstButton = document.getElementById("first");
var h1 =document.querySelector("h1");
var buttonsDiv = document.getElementsByClassName("buttons");
var firstClick = function() {
h1.innerHTML = "Do you know what FizzBuzz is?";
firstButton.innerHTML = "No";
firstButton.removeEventListener("click", firstClick);
var yesButton = document.createElement("button");
yesButton.innerHTML = "Yes";
buttonsDiv[0].appendChild(yesButton)
var secondClickNo = function() {
window.location.href='no.html';
}
var secondClickYes = function() {
window.location.href='play.html';
}
firstButton.addEventListener("click", secondClickNo);
yesButton.addEventListener("click", secondClickYes);
}
firstButton.addEventListener("click", firstClick);