You can do it with regular JavaScript this way:
document.getElementById('h1_id').innerHTML = 'h1 content here';
Here is the doc for getElementById and the innerHTML property.
The innerHTML
property description:
A DOMString containing the HTML serialization of the element's descendants. Setting the value of innerHTML removes all of the element's descendants and replaces them with nodes constructed by parsing the HTML given in the string htmlString.