...

View Full Version : Resolved Changing H1 Header Text



ajetrumpet
07-17-2009, 08: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!

jerry62704
07-17-2009, 08:21 PM
innerHTML

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

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



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum