I had a task a few days ago where I wanted to make web content appear and disappear depending on some backend DB constraints.
So CSS/DHTML was the obvious choice!!
By setting “style.visibility ” to either ‘visible’ or ‘hidden’ you can reveal or hide web content with ease.
so off I went and coded……….
I made the required div tags <div id=’$id’> around the content that I wanted to appear/disappear (where the $id is from the DB).
i.e. <div id=$id>
Well…what do you know….. it would not work.
so I changed the code as follows.
I added the letters “tagid_” before the id in the div tag
i.e <div id=’tagid_$id’>
and then hide it as follows
And THIS worked like a dream..
PS!!… the code below was NOT run in a browser to check for validity.. it is only the idea.
Here is the basic sample code in full:
1. The div tags:
<div id=’tagid_$id’ >
2. The Onmouseover() event:
And this seemed to work great.
Hope this helps someone out.