-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathappday16.js
34 lines (31 loc) · 1.17 KB
/
appday16.js
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
// document.querySelector('.simplebutton').addEventListener('click', onClick);
// function onClick(e) {
// let val = e;
// val = e.target;
// val = e.target.className;
// val = e.type;
// val = e.timeStamp;
// val = e.clientY;
// val = e.clientX;
// val = e.offsetY;
// val = e.offsetX;
// console.log(val);
// }
const button = document.querySelector('.simplebutton');
const heading = document.querySelector('#task-heading');
const card = document.querySelector('.card');
// button.addEventListener('dblclick', runEvent);
// button.addEventListener('click', runEvent);
card.addEventListener('mouseover', runEvent);
card.addEventListener('mouseout', runEvent);
card.addEventListener('mouseenter', runEvent);
card.addEventListener('mouseleave', runEvent);
// card.addEventListener('mousemove', runEvent);
function runEvent(e) {
// heading.textContent = `MouseX: ${e.offsetX}, MouseY: ${e.offsetY}`;
// document.body.style.backgroundColor = `rgb(${e.offsetX},${e.offsetY},100)`;
// console.log(`MouseX: ${e.offsetX}, MouseY: ${e.offsetY}`);
console.log(`Event Type: ${e.type}`);
}
const form = document.querySelector('.input');
form.value = '';