DekGenius.com
Team LiB   Previous Section   Next Section
Input.focus( ) give keyboard focus to a form element

Availability

JavaScript 1.0

Synopsis

input.focus(  ) 

Description

The focus( ) method of a form element transfers keyboard focus to that element without calling the onfocus event handler. That is, it makes the element active with respect to keyboard navigation and keyboard input. Thus, if you call focus( ) for a Text element, any text the user types appears in that text element. Or, if you call focus( ) for a Button element, the user can invoke that button from the keyboard.

All form elements except the Hidden element support the focus( ) method. Unfortunately, not all platforms support keyboard navigation equally well. In Unix versions of Netscape, focus( ) is functional only for those form elements that display text: Text, Textarea, Password, and FileUpload.

    Team LiB   Previous Section   Next Section