-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtut18.js
More file actions
31 lines (24 loc) · 891 Bytes
/
tut18.js
File metadata and controls
31 lines (24 loc) · 891 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
console.log("welcome to tut18.")
let btn = document.getElementById('btn_form');
btn.addEventListener('click', func1);
btn.addEventListener('dblclick', func2);
btn.addEventListener('mousedown', func3);
function func1(e) {
console.log("thank you for submit");
e.preventDefault(); // to stop default behaviour
}
function func2(e) {
console.log("you have double clicked");
e.preventDefault();
}
function func3(e) {
console.log("your have moved mouse down");
e.preventDefault();
}
document.querySelector("#inputEmail4").addEventListener('click', function () {
console.log("you have clicked in email field");
})
document.querySelector(".container").addEventListener('mousemove', function(e){
console.log('x='+ e.offsetX, 'y='+ e.offsetY);
//document.body.style.backgroundColor = `rgb(${e.offsetX}, ${e.offsetY}, 200)`;
})