hey,

i'm using a javascript script to disable form elements depending on conditions. part of the script requires a div tag with a unique id to surround the elements that are to be disabled. because of the way this works, each small group of elements needs its own div tag and hence, its own id.

so this is how it breaks down:

disableDiv.style.color ='black';
disableDiv2.style.color ='black';
disableDiv3.style.color ='black';
disableDiv4.style.color ='black';
disableDiv5.style.color ='black';
disableDiv6.style.color ='black';

as you can see, these div ids have a text color attribute of 'black'. i have to set 6 of these variables to the same value, which is annoying to say the least when doing it manually. i can not use an array because the div id's can not be arrays.

so the question is, how can i use a for loop to set the same value for all of these div id's?

i was thinking something along the lines of this:

for (var x = 0; x <= 2; x++)
{
(disableDiv + x) ='black'
}

i don't know javascript very well so i'm not sure what to change to get it to work.