How to detect which element is in focus

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • moishy
    New Member
    • Oct 2006
    • 104

    How to detect which element is in focus

    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
    • Jan 2008
    • 1653

    #2
    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

    Working...