Hello,
i have a question again will nested loops cause
a problem ? for example i have the following code
if(document.myForm.box6.value=="" && Math.random()<0.5){
document.myForm.box6.value="O";
document.myForm.box6.style.color="Blue"
}
else if(document.myForm.box6.value==""){
document.myForm.box6.value="X";
document.myForm.box6.style.color="Blue"
}
else if(document.myForm.box1.value=="" && Math.random()<0.5){
document.myForm.box1.value="O"
document.myForm.box1.style.color="Blue"
}
else if(document.myForm.box1.value==""){
document.myForm.box1.value="X";
document.myForm.box1.style.color="Blue"
}
and it gets bigger but when i click on the buttons they dont always show the value and that means that something is wrong and i dont understand the reason.
is it because of the nested if??
i have a question again will nested loops cause
a problem ? for example i have the following code
if(document.myForm.box6.value=="" && Math.random()<0.5){
document.myForm.box6.value="O";
document.myForm.box6.style.color="Blue"
}
else if(document.myForm.box6.value==""){
document.myForm.box6.value="X";
document.myForm.box6.style.color="Blue"
}
else if(document.myForm.box1.value=="" && Math.random()<0.5){
document.myForm.box1.value="O"
document.myForm.box1.style.color="Blue"
}
else if(document.myForm.box1.value==""){
document.myForm.box1.value="X";
document.myForm.box1.style.color="Blue"
}
and it gets bigger but when i click on the buttons they dont always show the value and that means that something is wrong and i dont understand the reason.
is it because of the nested if??