0 points

Add Code to HTML by Manipulating the DOM


Posted by @mishka #html #javascript

const randomElement = document.getElementById('someElement');
randomElement.innerHTML = '<p>changing the DOM</p>'
content_copy Copy

The Document Object Model (DOM) is a representation of HTML that can be changed and manipulated with code. For us, that means we'll be able to write JavaScript code that dynamically changes our HTML in the browser.