Skip to content

Commit 4c44918

Browse files
committed
domtask
1 parent 398aff7 commit 4c44918

File tree

2 files changed

+30
-0
lines changed

2 files changed

+30
-0
lines changed

Dom Task/index.html

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
6+
<title>DoM Manipulation</title>
7+
</head>
8+
<body style="background-color: black; color: white;" >
9+
10+
<h1 id="first">Hello</h1>
11+
<script src="./script.js"></script>
12+
</body>
13+
</html>

Dom Task/script.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
2+
/*
3+
4+
Create a new Element and Print it after heading
5+
*/
6+
7+
8+
const newElement=document.createElement("h2")
9+
10+
newElement.textContent="Javascript"
11+
12+
13+
const element=document.getElementById("first")
14+
15+
element.after(newElement)
16+
17+

0 commit comments

Comments
 (0)