Use JavaScript to add or remove elements from the DOM.
Source Code
let newDiv = document.createElement('div');
newDiv.textContent = 'New element';
document.body.appendChild(newDiv);
// Remove the element
document.body.removeChild(newDiv);
Use JavaScript to add or remove elements from the DOM.
let newDiv = document.createElement('div');
newDiv.textContent = 'New element';
document.body.appendChild(newDiv);
// Remove the element
document.body.removeChild(newDiv);