The best HTML DOM Methods Tutorial In 2024, In this tutorial you can learn Programming Interface,getElementById () method,Examples,HTML DOM objects - methods and properties,Real-life objects,Some DOM object methods,
The method is an action that we can perform on the node (HTML elements).
By JavaScript (and other programming languages) to HTML DOM access.
All HTML elements are defined as an object, and the programming interface is object method and object properties.
The method is an operation (such as adding or modify elements) that you can perform.
Property is that you can get or set value (for example, node name or content).
getElementById () method returns the element with the specified ID:
Some commonly used HTML DOM methods:
Some commonly used HTML DOM attributes:
In this tutorial you will learn more about the next chapter property.
A person is an object.
One approach might be to eat (), sleep (), work (), play (), and so on.
These methods all have, but they will be executed at different times.
A person's property, including their name, height, weight, age, sex and so on.
Everyone has these properties, but their values vary.
Here are some common methods you learned in this tutorial to:
method | description |
---|---|
getElementById () | Returns the element with the specified ID. |
getElementsByTagName () | Returns a list of nodes (set / node array) containing all elements with the specified tag name. |
getElementsByClassName () | Returns a list of all of the elements with the specified node contains the name of the class. |
appendChild () | To add a new child node to the specified node. |
removeChild () | Removes the child node. |
replaceChild () | Replace child nodes. |
insertBefore () | Insert a new child node in front of the specified child node. |
createAttribute () | Create attribute node. |
createElement () | Create an element node. |
createTextNode () | Create a text node. |
getAttribute () | Returns the specified attribute values. |
setAttribute () | To set or modify the specified value of the specified property. |