J
Janis Papanagnou
The task seems simple but I am not sure whether this is possible or even
the right way to look at it...
I have <td class="X"> elements where "X" is a placeholder for class names
"A", "B", etc. Now I want to display/hide all <td> elements of a certain
class, say "A". The static CSS equivalent would be
<style type="text/css">
.A { visibility:visible; }
.B { visibility:hidden; }
...
</style>
but is it possible to dynamically change the visibility attribute for all
<td> elements of a certain class "A" using javascript in a simple way?
I mean, something syntactic simple like the pseudo code
document.<whatever("A")>.visibility = hidden;
Or do I have to iterate over the DOM tree and compare each element against
the class name?
Any hints very much appreciated.
the right way to look at it...
I have <td class="X"> elements where "X" is a placeholder for class names
"A", "B", etc. Now I want to display/hide all <td> elements of a certain
class, say "A". The static CSS equivalent would be
<style type="text/css">
.A { visibility:visible; }
.B { visibility:hidden; }
...
</style>
but is it possible to dynamically change the visibility attribute for all
<td> elements of a certain class "A" using javascript in a simple way?
I mean, something syntactic simple like the pseudo code
document.<whatever("A")>.visibility = hidden;
Or do I have to iterate over the DOM tree and compare each element against
the class name?
Any hints very much appreciated.