This is a discussion on "need help on innerHTML" within the JavaScript Forum section. This forum, and the thread "need help on innerHTML are both part of the Program Your Website category.
|
|
|
|
|
![]() |
||
need help on innerHTML
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
|||
|
need help on innerHTML
i've been trying to print some message in <div id="information">
these messages were stored in the var info here's the html code
if i change the last line to document.write(info); i get the message that i want though it is not printed inside the information div How can i get those message to be printed in specific div?? thx! Last edited by karinne; Dec 3rd, 2007 at 14:35. Reason: Please use vBcode when inserting code in your post. |
|
|
|
||||
|
Re: need help on innerHTML
change the last line to
document.getElementById("information").innerHTML = info; You don't need to use document.write to add to innerHTML, you just use the value you want added. document.write tries to destroy the page and start a new one. Cheers
Last Blog Entry: The wannabe juggler's quest (Oct 27th, 2007)
|
|
|||
|
Re: need help on innerHTML
Thank you very much!
i've followed your advice and changed the last line there's a new problem though. the ";" didn't seem to end the operation of document.getElementById("information").innerHTML = info; an error cascades downward from thereon and other functions after this line could not be run. what went wrong this time? |
![]() |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| innerHtml doesn't retrive the formatting from DIV | shamail | ASP.NET Forum | 0 | Aug 24th, 2007 20:02 |
| Changing innerHTML not really working in IE | Zonglars | JavaScript Forum | 2 | Jul 26th, 2007 20:31 |
| innerHTML and innerHTML match | DregondRahl | JavaScript Forum | 2 | Jun 11th, 2007 13:24 |
| how to use innerHTML for preview in Kevin Roth's rte | mel03 | JavaScript Forum | 2 | Dec 22nd, 2006 12:15 |
| innerHTML in IE | TheDC | JavaScript Forum | 6 | Oct 30th, 2006 21:18 |