-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdom7.html
More file actions
30 lines (26 loc) · 720 Bytes
/
dom7.html
File metadata and controls
30 lines (26 loc) · 720 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
<!DOCTYPE html>
<html lang="em">
<head>
<script>
const sum=function(x=0,y=0,z=0){//default params
return x+y+z;
}
</script>
<title>DOM</title>
</head>
<body>
<h3>demo on element object (events)</h3>
<button id="bt1">Push here </button>
<button id="bt2"> Pull here </button>
<hr>
<script>
const b1=document.querySelector("#bt1");
b1.addEventListener("click", function(){
alert("hey, why ur pushed me");
} );
const b2=document.querySelector("#bt2");
//b2.onclick=function(){alert("oooey, why ur pulling me");}
b2.onmouseover=function(){alert("oooey, why ur pulling me");}
</script>
</body>
</html>