javascript display menu stall on first onclick
Posted: Wed Jun 04, 2003 5:00 pm
Hello,
the following is a script that checks a div tag for its display attribute and sets it the opposite
function menu(id)
{
temp_Obj = attach(id);
element = temp_Obj.style.display;
if(element == 'none'){
temp_Obj.style.display = 'inline';
}else{
temp_Obj.style.display = 'none';
}
}
but on the first onClick = menu('submenu') it doesnt do any thing(divs are set to done by default css)
however on a second attempt it will
Whats wrong?
Kendall
the following is a script that checks a div tag for its display attribute and sets it the opposite
function menu(id)
{
temp_Obj = attach(id);
element = temp_Obj.style.display;
if(element == 'none'){
temp_Obj.style.display = 'inline';
}else{
temp_Obj.style.display = 'none';
}
}
but on the first onClick = menu('submenu') it doesnt do any thing(divs are set to done by default css)
however on a second attempt it will
Whats wrong?
Kendall