CiberTHuG
Mar 28th, 2001, 02:36 PM
Okay... I have a series of document objects
<table>
<tr id='objRow'></tr>
<tr id='objRow'></tr>
<tr id='objRow'></tr>
<tr id='objAnotherRow'></tr>
<tr id='objAnotherRow'></tr>
<tr id='objAnotherRow'></tr>
<tr id='objDifferentRow'></tr>
<tr id='objDifferentRow'></tr>
<tr id='objDifferentRow'></tr>
</table>
I have some onClick events that pass the name of one of these objects. Let's say I want to make them hide.
<script language=JavaScript>
function hide(x) {
for (var i = 0; i < x.length; i++) {
x\[i\].style.display = "none";
}
}
</script>
Well, it is looking for an object called x. I want to anonymously refer to the object, using x. How can I do this?
<table>
<tr id='objRow'></tr>
<tr id='objRow'></tr>
<tr id='objRow'></tr>
<tr id='objAnotherRow'></tr>
<tr id='objAnotherRow'></tr>
<tr id='objAnotherRow'></tr>
<tr id='objDifferentRow'></tr>
<tr id='objDifferentRow'></tr>
<tr id='objDifferentRow'></tr>
</table>
I have some onClick events that pass the name of one of these objects. Let's say I want to make them hide.
<script language=JavaScript>
function hide(x) {
for (var i = 0; i < x.length; i++) {
x\[i\].style.display = "none";
}
}
</script>
Well, it is looking for an object called x. I want to anonymously refer to the object, using x. How can I do this?