I wish to write the code below using FOR:
Code:
 document.form1.komp1[document.form1.komp1.selectedIndex].value = 1;
 document.form1.komp2[document.form1.komp2.selectedIndex].value = 1;
 document.form1.komp3[document.form1.komp3.selectedIndex].value = 1;
.....
How can I do that using FOR?
Code:
for (i=1;i<4;i++){
  document.form1.elements('komp'+i)[document.form1.elements('komp'+i).selectedIndex].value = 1;