W
WJ
I have some DHTML that is showing and hiding a div. This works in IE and
Firefox, but not in Netscape.
<html>
<head>
<script language="javascript">
function switchDisplay()
{
if (myDiv.style.display=='block')
myDiv.style.display='none';
else
myDiv.style.display='block';
}
</script>
</head>
<body>
<form myform. . . >
<myDiv style="display:block">
blah
</myDiv>
<input type="button" value="test me" onclick="javascript:
switchDisplay();">
</form>
</body>
</html>
In the javascript, I can refer to the div directly in IE and Firefox (and
Mozilla). It does nothing in Netscape.
I've tried document.myDiv.style.display,
document.elements['myDiv'].style.display, and trying to walk the DOM through
the form.
Any suggestions would be greatly appreciated.
Thx!
Firefox, but not in Netscape.
<html>
<head>
<script language="javascript">
function switchDisplay()
{
if (myDiv.style.display=='block')
myDiv.style.display='none';
else
myDiv.style.display='block';
}
</script>
</head>
<body>
<form myform. . . >
<myDiv style="display:block">
blah
</myDiv>
<input type="button" value="test me" onclick="javascript:
switchDisplay();">
</form>
</body>
</html>
In the javascript, I can refer to the div directly in IE and Firefox (and
Mozilla). It does nothing in Netscape.
I've tried document.myDiv.style.display,
document.elements['myDiv'].style.display, and trying to walk the DOM through
the form.
Any suggestions would be greatly appreciated.
Thx!