Home Articles FAQs XREF Games Software Instant Books BBS About FOLDOC RFCs Feedback Sitemap
irt.Org
#

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

You are here: irt.org | FAQ | JavaScript | Form | 2 | Q135 [ previous next ]

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?'

©2018 Martin Webb