Changing the Document Tree
Explore how to change the document tree structure and content using JavaScript DOM operations. Learn to update element text, attributes, and list properties to make web pages more interactive and dynamic.
We'll cover the following...
We'll cover the following...
It is great that you can traverse through the document tree and access its content. However, it is just a single step toward creating interactive pages.
The more exciting thing is to change the structure and content of the tree, and it opens totally new horizons to vivify your web pages.
The DOM contains about a dozen useful operations that allow you to change the document tree. Among the others, you can insert new elements, remove existing ones, and replace ...