<!DOCTYPE html><html lang="en"> <head> <meta charset="UTF-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <title>Document</title> </head> <body> <div id="div1">This is a div element.</div> <div id="div2">This is another div element.</div> <script> var div1 = document.getElementById("div1"); div1.innerText = "<h1>This is a new text.</h1>"; var div2 = document.getElementById("div2"); div2.innerHTML = "<h1>This is a new text.</h1>"; </script> </body></html>