I use the following code to delete a character when the user presses the delete code. It works in Firefox but doesn't work in Google Chrome. What do I have to fix?
window.onkeypress = function(key) {
...
if (Guessing>0){
else if (key.keyCode == 8){//Delete key
PhraseEntry=PhraseEntry.substring(0, PhraseEntry.length - (1+back))
+ PhraseEntry.substring(PhraseEntry.length - back, PhraseEntry.length );
$("display_text").empty( ).append(PhraseEntry);
}
}
}
...