hi,
I have been playing around with JavaScript a i can’t seem to get the code below to work properly.
If I give backgroundColor(letter) a number between 0-9 it works fine but if I give it a-z it does not
work. All get in the in the console unexpected token, the alert shows the right letter I have pressed
any ideas?
function backgroundColor(letter){
alert(letter);
document.getElementById(letter).style.color = "orange";
window.setTimeout("backgroundReturn("+letter+")", 250);
}
/*returns the keybroad to white after keypress*/
function backgroundReturn(letter){
document.getElementById(letter).style.color = "white";
}