-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDay72Mouseevents2.html
36 lines (34 loc) · 1.24 KB
/
Day72Mouseevents2.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Day 72</title>
</head>
<body>
<div id="parentelem">
Hey child , have a happy life
<div id="childelem">
Thank you parent , you too have fun
</div>
</div>
<script>
parentelem.onmouseover=function(Event){
console.log('parentelem onmouseover',event.target.tagName);//where it is now
console.log('parentelemreleated onmouseover',event.relatedTarget.tagName);//where it is came from
}
parentelem.onmouseout=function(event){
console.log('parentelem onmouseout',event.target.tagName);//where it came from
console.log('parentelemreleated onmouseout',event.relatedTarget.tagName);//where it is now
}
childelem.onmouseenter=function(event){
console.log('child mouseenter',event.target.tagName);
console.log('childrelated onmouseenter',event.relatedTarget.tagName);
}
childelem.onmouseleave=function(event){
console.log('child leave',event.target.tagName);
console.log('childrelated leave',event.relatedTarget.tagName);
}
</script>
</body>
</html>