function serialfocus(){ // This function will work when serial field will get the focus } function serialinput(){ // This function will work when user will type the next symbol // alert(key); }