August 1999
Intermediate to advanced
1488 pages
72h 53m
English
submit.focus()
The focus() method of the Submit object places focus on the Submit button. Be careful when using this method in conjunction with the Submit.blur() method. It can lead to a focus/blur loop, where the browser blurs a focus as soon as it is done, and vice versa.
Listing 7.482 has a text box and a submit button. If the user clicks in the text box, focus is placed on the submit button.
<html> <head> <script language="JavaScript"> <!-- Hide // Define the setFocus function called by clicking in the text box function setFocus(){ // Place focus from the submit button. ... |
Read now
Unlock full access