-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
41 lines (39 loc) · 1.37 KB
/
index.html
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<link href="https://fonts.googleapis.com/css?family=VT323&display=swap" rel="stylesheet">
<link rel="stylesheet" type = "text/css" href="main.css">
<title>Calculator</title>
</head>
<body>
<div id = "flipper" onclick ="flip()">FLIP CALCULATOR</div>
<div id = "container">
<div class = "display" id = "display"></div>
</div>
<script type="text/javascript">
function downloadJSAtOnload() {
var element = document.createElement("script");
element.src = "pagescript.js";
document.body.appendChild(element);
}
if (window.addEventListener)
window.addEventListener("load", downloadJSAtOnload, false);
else if (window.attachEvent)
window.attachEvent("onload", downloadJSAtOnload);
else window.onload = downloadJSAtOnload;
function flip(){
console.log("clicked");
document.getElementById("container").classList.toggle("flipped");
if (document.getElementById("flipper").innerHTML == "FLIP CALCULATOR"){
document.getElementById("flipper").innerHTML = "LOL"
}
else{
document.getElementById("flipper").innerHTML = "FLIP CALCULATOR"
}
}
</script>
</body>
</html>