I'm attempting to write a very basic Sudoku game, and am having issues when it comes to testing the value of the input of each cell. Each cell has the following piece of code attached to it:
<div id="cell1" class="4"><input type="textarea" name="number" onkeypress="sudokuheck()"></div>
Then, I am trying to write a function that tests what's inputted in the Textarea against the Div's class. I know using integers as class names isn't the best idea, but I'm using HTML5, and am just trying to get it to work for now.
So far I've tried:
function sudokuCheck()
{
var x = document.onkeypress;
if (x = document.previousSibling.ClassName)
{
alert("correct");
}
else
{
alert("incorrect");
}
}
However, this just doesn't seem to be working. You guys have any idea how I can go about fixing it?
Thanks