Code:
function checkWin() { var val0; var val1; var val2; var status = _gel(status); //prob here // check columns for(var y = 0; y < 3; y++) { val0 = _gel('b0_'+y +".value"); //prob here val1 = _gel('b1_'+y +".value"); val2 = _gel('b2_'+y +".value"); if(val0 == 'X' && val1 == 'X' && val2 == 'X') { status.innerText = "X WINS!"; return true; } else if(val0 == 'O' && val1 == 'O' && val2 == 'O') { status.innerText = "O WINS!"; return true; } } // check rows for(var x = 0; x < 3; x++) { val0 = _gel('b'+ x + '_0').value; val1 = _gel('b'+ x + '_1').value; val2 = _gel('b'+ x + '_2').value; if(val0 == 'X' && val1 == 'X' && val2 == 'X') { status.innerText = "X WINS!"; return true; } else if(val0 == 'O' && val1 == 'O' && val2 == 'O') { status.innerText = "O WINS!"; return true; } } // check top left to lower right diagonal val0 = _gel('b0_0').value; val1 = _gel('b1_1').value; val2 = _gel('b2_2').value; if(val0 == 'X' && val1 == 'X' && val2 == 'X') { status.innerText = "X WINS!"; return true; } else if(val0 == 'O' && val1 == 'O' && val2 == 'O') { status.innerText = "O WINS!"; return true; } // check lower left to top right diagonal val0 = _gel('b2_0').value; val1 = _gel('b1_1').value; val2 = _gel('b0_2').value; if(val0 == 'X' && val1 == 'X' && val2 == 'X') { status.innerText = "X WINS!"; return true; } else if(val0 == 'O' && val1 == 'O' && val2 == 'O') { status.innerText = "O WINS!"; return true; } // no winner yet return false; }
this is a tic toe game
firstly (i put in comment) is that i cant get the status
second is i want to get the y value of my label name( my labels for playin are labeled as b0_0 b0_1 as so forth)
the sdk says object expected
Comment