...

View Full Version : many <DIV>-s created by JS?



Ovidiu
08-19-2002, 12:35 AM
How can I create 2 or more <div>-s through code? I mean for the onmouseover for the first <div> to show the second <div>. When I did that the 2nd <div> was shown but nothing else!!

dsvg
08-19-2002, 12:54 AM
More info would be helpful, but I would suggest you write the div's out as html and use JavaScript to control their style.display property. Set it to 'visible' to show the div, and '' to hide the div.

ConfusedOfLife
08-19-2002, 10:23 AM
Quote:

<p>
<hr>
When I did that the 2nd <div> was shown but nothing else!!
<hr>
</p>

I couldn't understand what you mean by this sentence! Anyway, you have to define an Id for each div, then you can call their id from anywhere that you like within your current, or maybe children or parent documents!
Then you can get the Id by "document.getElementById('yourId')" and do what you want.

ConfusedOfLife
08-19-2002, 10:24 AM
Quote:
-------------------------------------------------------------------------------
When I did that the 2nd <div> was shown but nothing else!!
-------------------------------------------------------------------------------

I couldn't understand what you mean by this sentence! Anyway, you have to define an Id for each div, then you can call their id from anywhere that you like within your current, or maybe children or parent documents!
Then you can get the Id by "document.getElementById('yourId')" and do what you want. [/B][/QUOTE]



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum