Way to tell which form element currently has focus?

S

Scott Navarre

Hello,

I was wondering if there is a way (through JavaScript) to find out which
of the form's elements currently has focus -- like returning an element name
or index number...

Thanks in advance,
Scott Navarre
 
L

lallous

Hello,

No idea, but I implement using my way:
1)set an onfocus handler to all your elements (using a for
loop/form.elements[])
2)that genericOnFocus() would update a global variable called
lastFocusElement
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top