javascript - Change Focus after button press -
i have simple button calls routine onclick. use
document.getelementbyid('start').disabled=true;
to disable button can not pressed again. on things there no problem after that. in 1 instance need detect key presses, or rather key releases once button klicked.i use
document.onkeyup=wichkeypressed;
to detect key press. works fine if not disable button, not work if disable button.
it must focus problem. if click mouse on blank area on screen, key press detected or without disabling button. have tried changing focus several other elements, far no go. have given body id , tried change focus it, results remain same.
i appreciate ideas on subject. thank you.
instead of disabling button, add css class , set flag preventing action happening again when button clicked.
Comments
Post a Comment