The main way that you will edit the HTML content of your webpage using JavaScript is, in it's simplest terms, a two-step process.
-
Define a variable as an element on the page by targeting it. Such as
let variableOne = document.getElementById('element-id'); -
Decide what part of it to change and assign it a new value. Such as
variableOne.innerHTML = '<p>New paragraph</p>'orvariableOne.value = 5;