Forum Moderators: open

Message Too Old, No Replies

Renew container

         

orion_rus

9:43 am on Nov 21, 2004 (gmt 0)

10+ Year Member



I have a div and i need to change content in it, may be you know any other decision when those there i can hide old div and make visible another?

kaled

12:46 pm on Nov 21, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



To hide/show a div, this is the code I use.

function ToggleDiv(DivName)
{ with (document.getElementById(DivName).style) {
if (display == "none")
display = ""
else display = "none";
}}

Actually, it should work on any element, not just divs

The div has a property called innerHTML (I think). I have never used this but I believe that by writing to this property you can do what you want.

I think innerHTML is valid for other elements, not just divs.

Kaled.