How to change htm h1 from nodejs

JavaScript
let h1 = document.getElementsByTagName('h1')[0];
h1.innerHTML = "Hello";
<html>
<head></head>
<body>  
    <h1></h1>
<script src='test.js'></script>     
</body>
</html>

Source

Also in JavaScript: