homerUK
10-13-2005, 04:12 PM
hi..
I've got the following function which works perfectly...
for (x=1;x<howMany;x++){
what = "b_" + whichProcess + "_" + x;
document.getElementById(what).style.display = '';
}
the function will pass how many elements there are to be changed along with their ID numbers... it's used to hide rows on tables... eg:
<tr id="b_1_1"></tr>
<tr id="b_1_2"></tr>
<tr id="b_1_3"></tr>
the above hide perfectly... but I have other rows such as
<tr id="b_1_1"></tr>
<tr id="b_1_2"></tr>
<tr id="b_1_3"></tr>
<tr id="b_2_1"></tr>
<tr id="b_2_2"></tr>
<tr id="b_3_1"></tr>
my question is how can I make a loop which will hide ALL elements which begin with "b_"
thanks for any help!
I've got the following function which works perfectly...
for (x=1;x<howMany;x++){
what = "b_" + whichProcess + "_" + x;
document.getElementById(what).style.display = '';
}
the function will pass how many elements there are to be changed along with their ID numbers... it's used to hide rows on tables... eg:
<tr id="b_1_1"></tr>
<tr id="b_1_2"></tr>
<tr id="b_1_3"></tr>
the above hide perfectly... but I have other rows such as
<tr id="b_1_1"></tr>
<tr id="b_1_2"></tr>
<tr id="b_1_3"></tr>
<tr id="b_2_1"></tr>
<tr id="b_2_2"></tr>
<tr id="b_3_1"></tr>
my question is how can I make a loop which will hide ALL elements which begin with "b_"
thanks for any help!