File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ One place JavaScript!
9
9
- [ Closures] ( #closures )
10
10
- [ Splice vs Slice vs Split] ( #diffs )
11
11
- [ Data Types] ( #datatypes )
12
+ - [ DOM] ( #dom )
12
13
13
14
<a name =“callback”/ >
14
15
@@ -149,3 +150,23 @@ Six primitive data types:
149
150
150
151
7. Object // This is not primitive data type.
151
152
153
+ <a name =“dom”/ >
154
+
155
+ #### DOM - Document Object Model
156
+
157
+ DOM(Document Object Model) is a crucial part for making any Web apps and Mobile apps interactive.
158
+ The DOM model represents a document with a logical tree. Each branch of the tree ends in a node, and each node contains objects.
159
+ Accessing DOM element, we can change the document structure, style and content.
160
+
161
+
162
+ ``` HTML
163
+ <h2 class =" hello" > Hello Github! </h2 >
164
+ ```
165
+
166
+ ``` javascript
167
+ let h2 = document .getElementsByTagName (' h2' )[0 ]; // Since getElementsByTagName returns an array, to access it need to add [0]
168
+ console .log (h2 .innerText ); // Hello Github!
169
+ console .log (h2 .className ); // Hello
170
+ ```
171
+ Such this, there are many other interface listed below in MDN.
172
+ [ List of DOM Interface] ( https://developer.mozilla.org/en-US/docs/Web/API/Document_Object_Model#DOM_interfaces )
You can’t perform that action at this time.
0 commit comments