edit html using javascript code example
Example 1: change text of element js
document.getElementById("p1").innerHTML = "New text!";
Example 2: edit html javascript
<p id="p1">Hello World!</p>
<script>
document.getElementById("p1").innerHTML = "New text!";
</script>