Jump to content

get css element by class??


adamhhh

Recommended Posts

hi guys, im doing some css with a little bit of javascript which when you click on a link it shows a div which was previously hidden.

 

It works fine by ID, but this will obviously only work for one ID. I have a lot of div classes which are dynamically generated with php, does anyone know how i would activate each one by class if that makes sense?

 

E.g if ive got this javascript to show a div id-

 

function show() {
  if (browserType == "gecko" )
     document.poppedLayer = 
         eval('document.getElementById(\'thumb_text3\')');

 

then its called here..

 

echo "<a href=\"#\" onClick=\"show()\">turn admin on</a>";

 

<div id='thumb_text3' style=\"visibility: hidden;\">

Link to comment
https://forums.phpfreaks.com/topic/44755-get-css-element-by-class/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.