You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The document object model, or DOM, is a programming interface for web documents. It represents the web page so that programs like JavaScript can change the document structure, content, and style. It provides a structured representation of the web page, making it easier for developers to interact with and manipulate web content.
1385
1385
1386
+
1. The DOM allows developers to swiftly respond to user actions in real time with JavaScript. Developers leverage the DOM to access and modify page content and structure.
1387
+
1388
+
2. The DOM bridges browser differences, ensuring consistent functionality across various platforms and simplifying cross-browser compatibility.
1389
+
1390
+
3. The DOM facilitates real-time content updates without requiring a full page refresh.
1391
+
1392
+
4. The DOM allows developers to attach event listeners to the elements, enabling them to respond to user interactions.
1393
+
1394
+
5. The DOM supports assistive technologies like screen readers and ensures inclusivity for users with disabilities. Dynamic and interactive features facilitated by the DOM, contribute to an improved user experience.
1395
+
1386
1396
- Document:
1387
1397
1388
1398
1. The term document refers to a web page or any XML document such as HTML, XHTML, or XML.
@@ -1419,7 +1429,17 @@ documentNode; // You will be able to see the entire document object.
1419
1429
1420
1430
2. Element nodes represent HTML elements such as div, p, a, and form the bulk of the DOM structure. To access the element node select the paragraph you want to inspect and select inspect. then navigate to the console tab and enter $0. It will output the HTML code and details of that specific element.
1421
1431
1422
-
3. Attribute nodes represent attributes of HTML elements including id, class, and src.
1432
+
3. Attribute nodes represent attributes of HTML elements including id, class etc and provide additional information about an element. To access the attributes, select the anchor tag you want to inspect and select inspect then navigate to the console tab and enter $0 getAttribute("href"); command. this will give you the link inside href.
4. Text nodes contain the text content within elements. To retrieve the text of the selected element, use the $0.textContent command. This will give the text content.
0 commit comments