-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
45 lines (35 loc) · 1.09 KB
/
index.js
File metadata and controls
45 lines (35 loc) · 1.09 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
// var document = {
// addEventListener: function() {
// }
// };
var button = document.querySelector('button#the-button');
button.addEventListener('mouseenter', function() {
// MAKE BACKGROUND COLOR RED
// 1. Get access body
var body = document.querySelector('body');
// 2. Add 'red-bg' class
body.classList.add('red-bg');
});
button.addEventListener('mouseleave', function() {
// MAKE BACKGROUND COLOR RED
// 1. Get access body
var body = document.querySelector('body');
// 2. Remove 'red-bg' class
body.classList.remove('red-bg');
});
// var input = document.querySelector('input');
// input.addEventListener('keydown', function(event) {
// switch (event.key) {
// case 'a':
// case 'e':
// case 'i':
// case 'o':
// case 'u':
// console.log('A VOWEL WAS PRESSED!!!');
// }
// });
// function mousemoveCallback(event) {
// console.log(event.pageX, event.pageY);
// }
// document.addEventListener('mousemove', mousemoveCallback);
// document.removeEventListener('mousemove', mousemoveCallback);