Exercise 11.1

This commit is contained in:
Karan 2021-11-24 22:18:36 +05:30 committed by GitHub
parent 8528321836
commit dcf4b32022
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

26
Chapter 11/Exercise 11.1 Normal file
View 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>