Page 1 of 1

how can i show a div having id dynamically generating by php

Posted: Fri Jan 18, 2008 11:24 pm
by djdon11
hello Friends

i have an issue of javascript. actually i am hiding and showing a div with a javascript by using the id's of div
now the problem is that the divs are now gerating dynamically by a loop of php so now the id of the div are dynamic so how can i use this id to pass it to the javascript function to show and hide the div


please any body help me

Re: how can i show a div having id dynamically generating by php

Posted: Sat Jan 19, 2008 12:40 am
by potato
repeating your loop that generated the dynamic div id's, but now with the javascript in the loop?

Re: how can i show a div having id dynamically generating by php

Posted: Sat Jan 19, 2008 3:15 pm
by Jonah Bron
do it like this:

Code: Select all

document.getElementById('2, for example').style.display=none;
The javascript above uses css to hide the div.