This is sorta my first little javascript, and I'm not having any success
getting it to work:
=============== ======
function switchdiv()
{
ShowHide('displ ay');
ShowHide('edit' );
}
function ShowHide(divId)
{
var id = document.getEle mentById(divId) ;
if (id.style.displ ay == "none")
{
eval("id.style. display = 'block';");
}
else
{
eval("id.style. display = 'none';");
}
}
=============== =====
When I call switchdiv, the script succeeds at hiding 'display' but
doesn't seem to show 'edit'. However, if I run switchdiv like this:
=============== ====
function switchdiv()
{
ShowHide('edit' );
}
=============== ===
....it shows 'edit' just fine. I must be missing something obvious!
Thanks for any help!
--Brent
getting it to work:
=============== ======
function switchdiv()
{
ShowHide('displ ay');
ShowHide('edit' );
}
function ShowHide(divId)
{
var id = document.getEle mentById(divId) ;
if (id.style.displ ay == "none")
{
eval("id.style. display = 'block';");
}
else
{
eval("id.style. display = 'none';");
}
}
=============== =====
When I call switchdiv, the script succeeds at hiding 'display' but
doesn't seem to show 'edit'. However, if I run switchdiv like this:
=============== ====
function switchdiv()
{
ShowHide('edit' );
}
=============== ===
....it shows 'edit' just fine. I must be missing something obvious!
Thanks for any help!
--Brent
Comment