My code does not work , i cannot find what is wrong with it.
Please help me ! i don not want to use onclick in HTMl file to make unobtrusive javascript.
html
<form id="checkSudoku" action="#">
<input type="button" value="Check" id="check" />
</form>
javascript.
function check()
{
var check=document.getElementById('checkSudoku');
var checkbutton=check.getElementsByTagName('input');
for( var i=0; i < checkbutton.length; i++ ){
checkbutton[i].onclick=function(){
alert("hi");
}
}