Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 363401
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T13:20:20+00:00 2026-05-12T13:20:20+00:00

I like to know what the onFocus event is (if there will be any)

  • 0

I like to know what the onFocus event is (if there will be any) when I receive an onBlur event in my (JavaScript) handler. How is this possible?

Example: I have a group of textboxes that form one group. Only if the whole group loses focus I want to inform subscribers about the group onBlur event. So if an onBlur event occurs I only want to forward it when I notice that it’s not followed by an onFocus event on another textbox in the group.

I do this now through a delay and looking if a focus event occurred in the meantime. But I don’t like this solution so much as: because of the delay the blur occurs after the focus and the event that it contained in the delayed blur is "old" which can be tricky in further processing.

My idea was: looking in the "event queue", when I receive the blur event, to detect any onFocus event that will follow, but I have no idea if this is possible and how to do this.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T13:20:21+00:00Added an answer on May 12, 2026 at 1:20 pm

    — Edit:

    Having reviewed your question I’m not quite sure what you’re asking, so I’m not sure if what I’ve posted is suitable. Regardless, I leave it here for consideration.

    You can do it quite trivially with a map and the ‘this’ variable:

    var map = new Object();
    
    ...
    
    function doBlur (obj) {
       if(map[obj] == "focus"){
       }
    }
    
    function doFocus (obj) {
        map[obj] = "focus";
    }
    
    <input onblur="doBlur(this);" onfocus="doFocus(this);" />
    

    But even further, given that only one textbox can be focused at a time, you can just have a variable named lastFocus, and check that that object equals the one you want.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I like to know is there any specific reason that there is no public
I know it's possible to run JavaScript from the address bar, but are there
I have a text box like below : <asp:TextBox ID=headertxtUserName runat=server Text=User Name onfocus=onfocusOfUserName(this);
I'd like know if there are a way to test if a word have
This is possibly a candidate for a one-line answer. I would like know it
I have a function, this function receive a string in argument. The content of
i've made a textbox widget which will highlight onFocus (and un-highlight onblur). my question:
I would like know what is the best possible way to implement transactions with
I have some other javascript functions that are being set on the onfocus and
I'd really like know if it's possible to do a select statement, which returns

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.