-
setting display property for div in array
I am trying to set up page so that one field is not displayed with the page loads. i am pulling the content from a database, so it is in an array. How can I identify the DIV's so that I can manipulate them.
I can do this with straight HTML and JavaScript, but can't figure it out with the array. because the content is dynamic between pages, I can't specify a head of time how many DIVs there will be in the CSS for each page.
I hope this makes sense...Thanks
-
-
Well, if everything is dynamic, then it can't be done. There has to be some constant -- the same class, the same id.
So, what's constant between the pages? What, exactly, are you trying to hide? Does what you're trying to hide change from page to page?
-
-
essentially I have a shopping cart, and I want to display the names of the items and the prices in a list form, then have a button to click to see the description. so the descriptions would be display: none; but of course, if I set them all with the same ID then they all pop up when I click to display....I have seen it work on other sites, but I may actually be going about it the wrong way.
-
-
Ok, do this:
Apply the same class to all of your description divs (it sounds like you have more than one).
Then use the javascript I helped another poster with here.
You have to use JavaScript to manipulate the CSS styles.
-
The Following User Says Thank You to Medyman For This Useful Post:
-
-
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
Bookmarks