Exercise 11.1
This commit is contained in:
parent
8528321836
commit
dcf4b32022
26
Chapter 11/Exercise 11.1
Normal file
26
Chapter 11/Exercise 11.1
Normal file
@ -0,0 +1,26 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<title>Laurence Svekis</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<script>
|
||||
let darkMode = false;
|
||||
window.onclick = () => {
|
||||
console.log(darkMode);
|
||||
if (!darkMode) {
|
||||
document.body.style.backgroundColor = "black";
|
||||
document.body.style.color = "white";
|
||||
darkMode = true;
|
||||
} else {
|
||||
document.body.style.backgroundColor = "white";
|
||||
document.body.style.color = "black";
|
||||
darkMode = false;
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
Loading…
x
Reference in New Issue
Block a user