View Full Version : Resolved Changing H1 Header Text

07-17-2009, 09:18 PM
Hello all,

I am looking for a way to dynamically change the text of a header. it is a level 1 header, and I want to change the text in it dynamically, on click of an image. I have done this with other attributes of div images, by using this code for example:
document.getElementById("pic1").style.backgroundColor = 'rgb(255,0,0)'what i need is something like this i think:
document.getElementById("HEADER ID").TEXT = "HEADER TEXT HAS CHANGED"i'm not sure what the "text" attribute should be. i know ''text'' is not right. i've tried others too...like innerText, Caption, Value. I've googled the heck out of this, and can't get anywhere. a push in the right direction appreciated! thanks!

07-17-2009, 09:21 PM

Details here (http://www.w3schools.com/htmldom/prop_anchor_innerhtml.asp)

07-17-2009, 10:18 PM
document.getElementById("HEADER_ID").firstChild.nodeValue = "Header text here";