-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathindex.html
40 lines (34 loc) · 1003 Bytes
/
index.html
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Document</title>
</head>
<body>
<h2>JavaScript Course</h2>
<button>Click Me</button>
<script src="./index.js"></script>
<script>
function handleClick() {
console.log('Click')
}
var button = document.querySelector('button')
function func() {
console.log('clicked')
}
button.addEventListener('click', func)
setTimeout(function () {
button.removeEventListener('click', func)
}, 5000)
button.addEventListener('click', function () {
console.log('salam')
})
// button.addEventListener('click', function (event) {
// // console.log(event.target.previousElementSibling)
// // console.log(event.target.parentElement.children)
// // console.log(event.timeStamp)
// })
</script>
</body>
</html>