eg****@gmail.com a écrit :
I have multiple elements with the same class ID.
with the same class or the same id ?
it is absolutely forbiden to have more than ONE element with same id !
I want to Hide them
all, but I only know how to select one element at a time, e.g.
Element.hide('element). How can I do this to multiple elements with the
same id or class name?
No you can't with same id because id is unique on a same page :-(
If elements are with same class :
You can create a special class for the body which will say to this class
: hop! hide !
<style type="text/css">
..normal { color: blue }
..hid .normal { visibility: hidden }
</style>
<script type="text/javascript">
function hidShw(){
document.body.className = document.body.className==''? 'hid' : ''; }
</script>
<div class="normal">text 1</div>
<div>
<p>text 2</p>
<p class="normal">text 3</p>
</div>
<p><button onclick="hidShw()">Hide/Show blue elements</button></p>
<h3>text 4</h3>
<h2 class="normal">text 5</h2>
PS. I have access to prototype....
why not a panzer division ?
--
Stephane Moriaux et son (moins) vieux Mac déjà dépassé
Stephane Moriaux and his (less) old Mac already out of date