Way to tell which form element currently has focus?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Scott Navarre

    Way to tell which form element currently has focus?

    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


  • lallous

    #2
    Re: Way to tell which form element currently has focus?

    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
    lastFocusElemen t

    --
    Elias
    "Scott Navarre" <smn@asus.net > wrote in message
    news:bv4c2302io d@enews4.newsgu y.com...[color=blue]
    > 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[/color]
    name[color=blue]
    > or index number...
    >
    > Thanks in advance,
    > Scott Navarre
    >
    >[/color]


    Comment

    Working...