Home Articles FAQs XREF Games Software Instant Books About Feedback Search Site-Map
irt.org logo

Q135 I know how to focus on a specific element but how do I know what is currently focused?

irt.org | Knowledge Base | JavaScript | Form 2 | Q135 [ previous next ]

Q135 I know how to focus on a specific element but how do I know what is currently focused?

There is nothing inbuilt that will provide this information for you. What you could do is monitor this yourself by declaring a variable which holds the information of the element that has the focus, and then monitoring it using onFocus() and onBlur() event handlers to keep the variable updated.

All form elements except hidden support onFocus(), however on UNIX, Netscape 2 and 3 only support onFocus() for text entry type fields, i.e. text,textarea and fileupload.

Feedback on 'Q135 I know how to focus on a specific element but how do I know what is currently focused?'


Provide feedback ...
AddThis Social Bookmark Button

Provide feedback ... AddThis Social Bookmark Button


Last Updated: 30th March 2008. Maintained by: Martin Webb and Michel Plungjan
irt.org liability, trademark, document use, privacy statement and software licensing rules apply.
Copyright © 1996-2008 irt.org, All Rights Reserved.