We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b8883dd commit a585d37Copy full SHA for a585d37
1 file changed
js_basics/dom/d2.html
@@ -0,0 +1,28 @@
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 Learning</title>
7
+ <style>
8
+ .bg-black{
9
+ background-color: #212121;
10
+ color:white;
11
+ }
12
+ </style>
13
+</head>
14
+<body class="bg-black">
15
+
16
+</body>
17
+<script>
18
+ const div = document.createElement('div');
19
+ div.className = "main";
20
+ div.id = Math.round(Math.random()*10+1)
21
+ div.setAttribute("title","generated title");
22
+ div.style.backgroundColor = "orange"
23
+ // div.innerHTML = "Hello Krish";
24
+ const addText = document.createTextNode("chai aur code");
25
+ div.appendChild(addText);
26
+ document.body.appendChild(div);
27
+</script>
28
+</html>
0 commit comments