View Full Version : <DIV> tag has no properties?

06-07-2003, 02:50 AM
I'm trying to make a section of code within a <div> tag appear when I click or MouseOver a button. I have something like this for my code.

<style ...>
#hd {...;visibility: hidden}
<input type="button" onMouseOver="document.HiddenDiv.style.visibility='visible'" onMouseOut="document.HiddenDiv.style.visibility='hidden'">
<div id="hd" name="HiddenDiv">

When I run it in either Netscape7 or IE5 I get a message saying that document.HiddenDiv has no properties, which I assume means that JS isn't recognizing it as the name of an HTML tag. I was wondering how I might go about doing this, because I am completely baffled and have tried everything else.


06-07-2003, 02:58 AM
You're using an older style of object referencing (DOM 0); this isn't only inadvisable, but it never worked with elements like a div (only named images, forms, etc.). ID your elements:

<div id="hd">



Just fyi: once your HTML has been parsed (read), you deal with objects/properties, not 'tags'. Helps to think of it this way.

06-07-2003, 03:07 AM
Thank you very much for your help... can't believe I just got this answer in 10 minutes after searching for about 2 days.


PS: Gotta comment on how fast the reply was. Thanx.

06-07-2003, 03:11 AM
...and the price wasn't bad, either. :D

Superb read:


EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum