Change srcElement to target and charCode to keyCode for Firefox compatibility.