How it Works: Changing the DOM
In this lesson, let's understand the implementation of the DOM manipulation exercise. Let's begin!
We'll cover the following...
How it works
The marker is added to the heading with this code line:
Press + to interact
title.innerHTML = '<span class="mono">- </span>'+ title.innerHTML;
Here, title
represents the heading. The innerHTML
property can be used to access and set the content of an HTML element using textual HTML markup. Most HTML element may nest other markup elements. Although using the DOM operations, you can navigate from a parent element to its child or children. In many situations, it’s ...