-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathimg.html
More file actions
37 lines (34 loc) · 1.35 KB
/
Copy pathimg.html
File metadata and controls
37 lines (34 loc) · 1.35 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Add event Listener</title>
</head>
<body>
<h1 id="ab" >hlo</h1>
<img src="kunal (2).jpg" id="im1" >
<script>
// document.getElementById("ab").onclick = event;
// function event(){
// document.getElementById("ab").style.color = "blue";
// }
// document.getElementById("ab").addEventListener("mouseover",()=>{
// document.getElementById("ab").style.color = "gray";
// })
// document.getElementById("ab").addEventListener("mouseout",()=>{
// document.getElementById("ab").style.color = "blue";
// })
// document.getElementById("ab").addEventListener("click",()=>{
// document.getElementById("ab").style.color = "blue";
// document.getElementById("im1").style.backgroundColor = "yellow"
// })
document.getElementById("im1").addEventListener("mouseover",()=>{
document.getElementById("im1").style.filter = "grayscale(100%)"
})
document.getElementById("im1").addEventListener("mouseout",()=>{
document.getElementById("im1").style.filter = "grayscale(0%)"
})
</script>
</body>
</html>