Login or Sign Up
Logging in...
Remember me
Log in
Or
Sign Up
Forgot password or user name?
Log in with
Search in titles only
Search in Javascript only
Search
Advanced Search
Forums
BYTES
Product Launch
Updates
Developer Toolkit
Today's Posts
Member List
Calendar
Home
Forum
Topic
Javascript
How to detect which element is in focus
Collapse
X
Collapse
Posts
Latest Activity
Photos
Page
of
1
Filter
Time
All Time
Today
Last Week
Last Month
Show
All
Discussions only
Photos only
Videos only
Links only
Polls only
Events only
Filtered by:
Clear All
new posts
Previous
template
Next
moishy
New Member
Join Date:
Oct 2006
Posts:
104
#1
How to detect which element is in focus
Mar 20 '09, 08:44 PM
How can I find out which element has focus?
I know how to do it in IE, but I need something for Firefox.
Thanx
hsriat
Recognized Expert
Top Contributor
Join Date:
Jan 2008
Posts:
1653
#2
Mar 21 '09, 05:00 AM
There's no specific procedure. So what you can do is create a variable say
focusElement
which contains the id of the element in focus.
For the required elements, set
onfocus = "focusEleme nt = this.id;"
and
onblur = "focusEleme nt = null;"
Comment
Post
Cancel
Previous
template
Next
Working...
Yes
No
OK
OK
Cancel
👍
👎
☕
Comment