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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.