Jump to content

Finding element focus in IE


Recommended Posts

While I've been scripting with Autoit for a while (bowing down to it's excellence). I'm new to dealing with IE and IE.au3. I'm trying to find where the focus is on a page. I can activate the element focus with _IEAction, but I need to find the focus, similar to using ControlGetFocus in a GUI. If anyone can give me a push in the right direction I would appreciate it.

Link to comment
Share on other sites

You can use the hasFocus method to check focus, although I'm guessing you had to go through every element to find which one has focus at the moment. Might be inaccurate by the time it's completed searching. It's used like this:

$focus = $oElement.hasFocus()
If $focus = True Then
    ;has focus
Else
    ;doesn't have focus
EndIf
IE Dev ToolbarMSDN: InternetExplorer ObjectMSDN: HTML/DHTML Reference Guide[quote]It is surprising what a man can do when he has to, and how little most men will do when they don't have to. - Walter Linn[/quote]--------------------[font="Franklin Gothic Medium"]Post a reproducer with less than 100 lines of code.[/font]
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...