Menu
Hi I have this code:
var Lig1 = window.document.step4.light1;
if (Lig1.checked==true){
window.document.step4.light.value=1;
}
var Lig2 = window.document.step4.light2;
if (Lig2.checked==true){
window.document.step4.light.value=2;
}
var Lig3 = window.document.step4.light3;
if (Lig3.checked==true){
window.document.step4.light.value=3;
}
I want to do it with a loop.
I do it like this:
for (var y=1;y<4;y++){
var Lig+”y” = window.document.step4.light+”y”;
}
It is not working. What should I do?
thanks,
Assaf