-
HTML
-
CSS
- Introduction to CSS
- Before learning CSS?
- SELECTOR
- Example
- Box Model
- Comments
- Colors
- Background Color
- Text Color
- Border Color
- Backgrounds
- Borders
- Margins
- Padding
- Height, Width, and Max-width
- Outline
- Text
- Font Style, Font Size & Shorthand
- Links
- Display and Position
- Lists
- Tables
- Pseudo-classes and Combinators
- Flexbox
- Grid
- Flexbox vs Grid
- Responsive Web Design
- Media Queries
- Responsive Images
- Fluid Layouts
- Transforms, Transitions, and Animations
-
JavaScript
- Introduction to JavaScript
- Hello World
- Syntax
- Variables
- Data Types
- Numbers
- Boolean type
- String
- Objects
- Primitive vs Reference Values
- Arrays
- Arithmetic Operators
- Remainder Operator
- Assignment Operators
- Comparison Operators
- Logical Operators
- if statement
- if else
- if else if
- Ternary Operator
- Object Spread
- Switch case
- While Loop
- do…while Loop
- Loop
- break
- continue
- Functions
- Storing functions in variables
- Anonymous Functions
- Pass-By-Value
- Recursive Function
- Object Methods
- Constructor Function
- this Keyword
- Object Properties
- for…in Loop
- Object.values
- Object.assign
- Class
- Getters and Setters
- Function Type
- Closures
- Arrow Functions
- When You Should Not Use Arrow Functions
- Rest Parameters
- Callbacks
- Promises
- async/await
-
JavaScript DOM
- JavaScript DOM
- getElementById
- getElementsByName
- getElementsByTagName
- getElementsByClassName
- querySelector
- JavaScript Get the Parent Element parentNode
- Getting Child Elements
- JavaScript Siblings
- CreateElement
- appendChild
- JavaScript textContent
- JavaScript innerHTML
- JavaScript innerHTML vs createElement
- Working with Attributes
- JavaScript Style
- Working with Events
-
React
JavaScript DOM
What is Document Object Model (DOM)
The Document Object Model (DOM) is an application programming interface (API) for manipulating HTML documents.
The DOM represents an HTML document as a tree of nodes. The DOM provides functions that allow you to add, remove, and modify parts of the document effectively.
Note that the DOM is cross-platform and language-independent way of manipulating HTML and XML documents.
A document as a hierarchy of nodes
The DOM represents an HTML document as a hierarchy of nodes. Consider the following HTML document:
<html>
<head>
<title>JavaScript DOM</title>
</head>
<body>
<p>Hello DOM!</p>
</body>
</html>
The following tree represents the above HTML document:
In this DOM tree, the document is the root node. The root node has one child node which is the <html>
element. The <html>
element is called the document element.
Each document can have only one document
element. In an HTML document, the document
element is the <html>
element. Each markup can be represented by a node in the tree.