Change text inside <h2> Text I would change </h2> element using javascript

html, javascript

Solution

You can use innerHTML:

document.getElementById("something").innerHTML = "new text";

Problem

I need to change the text inside HTML element using javascript, but I have no idea about how to do it. ¿Any help? I've got it defined like: ``` <h2 id="something">Text I want to change.</h2> ``` Im trying to do it with: ``` document.getElementById("something").value = "new text"; ``` But it doesn't work. Thanks

Original source