-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path08app.js
More file actions
34 lines (27 loc) · 856 Bytes
/
08app.js
File metadata and controls
34 lines (27 loc) · 856 Bytes
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(".clear-tasks").addEventListener("click", function (e) {
console.log("HEllo World");
// e.preventDefault();
});
// with named function
document.querySelector(".clear-tasks").addEventListener("click", onClick);
function onClick(e) {
// console.log("Clicked");
// to know the target oject further we can do following
let val;
val = e;
// Event target element
val = e.target.className;
val = e.target.id;
val = e.target.classList;
// name nai change gardina pani milcha after an event of clicking
e.target.innerText = "HEllo";
// Event type
val = e.type; /*op=click..because click ko event thyo*/
// Coordinate event relative to the window
val = e.clientY;
val = e.clientX;
// Coordinate event relative to the element
val = e.offsetY;
val = e.offsetX;
console.log(val);
}