Hiding DIVs that "don't exist"??

wxdqz

New Member
Hi. I've been doing Javascript on and off for the past few years, and I've been working with a script recently, which just does not want to work.

This is what the page looks like:

<!----- Paul's Fancy Schmancy Menu Test --->
<html>
<head>
<title>Paul's Fancy Schmancy Menu Test</title>

<script langauge="Javascript">
function showMenu()
{
document.Menu1.style="position:absolute; TOP:8pt; LEFT:0pt; WIDTH:0pt; HEIGHT:0pt; Z-INDEX:66;";
}
</script>
</head>

<body>
<div ID="Menu1" style="position:absolute; TOP:8pt; LEFT:0pt; WIDTH:0pt; HEIGHT:0pt; Z-INDEX:44;">
<table bgcolor="#000000" width="20%">
<tr>
<td width="100%"><a href=http://www.webdeveloper.com/forum/archive/index.php/"javascript: showMenu();">Hello</a> </td>
</tr>
</table>
</div>

<div id="Menu2" style="position:absolute; visibility:hidden; TOP:8pt; LEFT:0pt; WIDTH:0pt; HEIGHT:0pt; Z-INDEX:55;">
<table bgcolor="#000000" width="20%">
<tr>
<td width="100%"><a href="Hello.html">bye</a> </td>
</tr>
</table>
</div>

</body>
</html>

Now, the idea is that when I click'Hello', the table with 'Bye' should become visible.

I would swear that this is right, yet for some reason its not working. Instead, I get the error:
document.Menu1 is not an object
So obviousley I am wrong. If anyone could tell me how I can access the style of that DIV any other way, I would be very gratefull.

~ Paul
 
Back
Top