corillo181 Posted October 26, 2007 Share Posted October 26, 2007 <script type="text/javascript"> function thank(){ document.getElementById('t').innerHTML = 'Thank you'; } onload = thank(); </script> <p id="t">hello</p> Link to comment https://forums.phpfreaks.com/topic/74935-why-this-does-not-work-innerhtml/ Share on other sites More sharing options...
corillo181 Posted October 27, 2007 Author Share Posted October 27, 2007 someone help please. or recommend a better forum for java script questions Link to comment https://forums.phpfreaks.com/topic/74935-why-this-does-not-work-innerhtml/#findComment-378985 Share on other sites More sharing options...
rajivgonsalves Posted October 27, 2007 Share Posted October 27, 2007 try this <script type="text/javascript"> function thank(){ document.getElementById('t').innerHTML = "Thank You"; } window.onload = thank; </script> <p id="t">hello</p> Link to comment https://forums.phpfreaks.com/topic/74935-why-this-does-not-work-innerhtml/#findComment-379082 Share on other sites More sharing options...
Lijoyx Posted November 2, 2007 Share Posted November 2, 2007 hai friend, this will solve ur problem and this is a good forum by the way. <html > <head> <script language="javascript"> function thank() { document.getElementById('t').innerHTML = 'Thank you'; } </script> </head> <body onload="thank();"> <span id="t"></span> </body> </html> Link to comment https://forums.phpfreaks.com/topic/74935-why-this-does-not-work-innerhtml/#findComment-383386 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.