473,320 Members | 1,823 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Getting all elements that share the same class - possible?

Hi everyone,

I have been using a script to toggle the visibility (via the "display"
property) of a specific ID hence a single elemnt on a page using
document.getElementById:
function ToggleIDvis() {
if (!document.getElementById) return false;

var targetIDvis = document.getElementById("hidden");

if (targetIDvis.style.display == "block") {
targetIDvis.style.display = "none";
} else {
targetIDvis.style.display = "block";
}
}

Now I would like to toggle the visibility of multiple elements on the
page and I'm wondering if there's a way to get those elements by a
certain class name.

Any hints are very much appreciated!

Cheers Martin

--
To reply by e-mail remove the "waste bin".
Jul 23 '05 #1
2 1221
Martin Sammtleben wrote:
Now I would like to toggle the visibility of multiple elements on the
page and I'm wondering if there's a way to get those elements by a
certain class name.
There is, but it is more efficient to manipulate the respective
CSS rule, if supported. Please search before you post:
<news:40**************@PointedEars.de>
--
To reply by e-mail remove the "waste bin".


To get replies by e-mail that are likely to come from communicative
people but from spambots, use the Reply-To header. If that does not
help, use spam filters.
PointedEars
Jul 23 '05 #2
In article <40**************@PointedEars.de>,
Thomas 'PointedEars' Lahn <Po*********@nurfuerspam.de> wrote:
Now I would like to toggle the visibility of multiple elements on the
page and I'm wondering if there's a way to get those elements by a
certain class name.


There is, but it is more efficient to manipulate the respective
CSS rule, if supported.


Following up on the issue I have managed to find what I needed to know
thanks to your post that pointed me into the right direction.

For anyone interested:

<http://developer.apple.com/internet/webcontent/styles.html>

also interesting:

<http://developer.apple.com/internet/webcontent/dom2ii.html>

Cheers Martin

--
To reply by e-mail remove the "waste bin".
Jul 23 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

17
by: John Hunter | last post by:
I have a largish data set (1000 observations x 100 floating point variables), and some of the of the data are missing. I want to try a variety of clustering, neural network, etc, algorithms on the...
5
by: Brandons of mass destruction | last post by:
Ok, I work for a small newspaper thats looking to translate our content to the web. XML sounds like a good way to do this, but i'm a little confused. Is it possible to have <b> and <i> tags in...
2
by: Ney André de Mello Zunino | last post by:
Hello. The issue is quite known: you have a block-level container holding a set of floated elements and you need that the container's content height take the floated elements' dimensions into...
2
by: Adrienne | last post by:
This page validates XHTML-Strict and the CSS validates as well. Opera and Netscape 7.0 display it correctly. There should be a film strip on the left side, bordered in red, a list of links at...
6
by: Jon Slaughter | last post by:
Is there any way to get the class type from a pointer? I'm working on a class that acts as a set: I have two classes, one called FSet and the other called Element. FSet inherets Element and...
10
by: darrel | last post by:
I have this structure: mypage.aspx (class = mypage) myusercontro.ascx On the mypage.aspx I can declare a variable: animal = "monkey" I can read this from the UC by simply doing this:...
2
by: dollar | last post by:
thanks for your reply Kevin, but I don't understand what do you mean t "NOT to do that", you mean to declare the same connection and sam class in every web form ? and what is the built-in...
15
by: Neo | last post by:
Hello All, I found that ASP.net website only accepts code withing site directory. This creates big hurdle in shairng code. How to share code between two websites, like the way share between two...
5
by: jediknight | last post by:
Is it possible to programmatically stop multiple browsers from getting the same session state? The problem I have is that whenever I open a new browse using File- I would like to stop this...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.