View Full Version : DIV innerHTML
Horus_Kol
08-12-2003, 12:27 PM
I am trying to make a dynamic form using javascript.
If an option is selected, a list of sub-options can appear.
I have tried using the following code to change the contents of a div element:
div_id.innerhtml = "new text and elements";
But this doesn't update the page - why?
Cheers,
HK
Vincent Puglia
08-12-2003, 02:11 PM
Hi,
Can't really tell with the code you supplied. However:
1) did you change the div's visibility? document.getElementById(divID).style.visibility = 'show';
(for 'newer' browsers only)
2) does 'div_id' include the complete DOM (see above)
If interested, see 'dHTML: an Introduction', a script/tutorial at my site (GrassBlade)
Vinny
Jon Hanlon
08-12-2003, 07:53 PM
Javascript/DHTML is case-sensitive.
Try:
div_id.innerHTML = "new text and elements";
Horus_Kol
08-13-2003, 03:58 AM
cheers Jon
got so used to using ALL lowercase when I program that i didn't realise some things dont like it.
HK
Jon Hanlon
08-13-2003, 06:46 PM
Yeah - Don't get me started on case-sensitivity.
I could KILL the idiot who first implemented it!
vBulletin® v3.6.7, Copyright ©2000-2009, Jelsoft Enterprises Ltd.