Hi Guys!
Im making sudoku game using javascript. i have created 9x9 table grid using JS and i managed to put values in table from JS array.
I have released a text box instead blank table where user can enter number to play the game.
now i want to get all the table values and text box value and compare with another array in java script but i cant seem to get the value.
Please help or any suggestion appreciated.
my code below
JAVASCRIPT
Im making sudoku game using javascript. i have created 9x9 table grid using JS and i managed to put values in table from JS array.
I have released a text box instead blank table where user can enter number to play the game.
now i want to get all the table values and text box value and compare with another array in java script but i cant seem to get the value.
Please help or any suggestion appreciated.
my code below
JAVASCRIPT
Code:
var easy=[["1","","5","","","2","","5","","1"],
["","1","","2","6","","3","","","4"],
["2","","8","","","","","5","7",""],
["3","2","","","2","","2","","","9"],
["","4","5","","","","","5","",""],
["7","","","2","3","","4","","6",""],
["","4","","9","","","","8","","3"],
["8","1","4","","9","","","","",""],
["2","","8","7","","","9","","2","1"],
];//end of arrays
for(col=0;col<column;col++)
{
for(rw=0;rw<row;rw++)
{
var id=document.getElementById('R'+rw+'C'+col).innerHTML=easy[col][rw];//adding value into table
}
}
//tring to get values
for(col=0;col<column;col++)
{
for(rw=0;rw<row;rw++)
{
var ID='R'+rw+'C'+col;
console.log(ID);
var d =document.forms[ID].elements["fv"].value;
}
}
Comment