-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdom6.html
More file actions
30 lines (26 loc) · 691 Bytes
/
dom6.html
File metadata and controls
30 lines (26 loc) · 691 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 (styles)</h3>
<h2 id="h" style="background:red ; color:yellow;">document object model</h2>
<hr>
<script>
const h2=document.querySelector("#h");
document.write(`${h2.style.color}
${h2.style.background} <br>`);
h2.style.color="white";
h2.style.background="blue";
h2.style.display="inline-block";
h2.style.boxShadow="0 0 15px red";
document.body.style.background="pink";
</script>
</body>
</html>