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 6591853
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T17:28:44+00:00 2026-05-25T17:28:44+00:00

I don’t understand why the jQuery blur handler isn’t working in the most simple

  • 0

I don’t understand why the jQuery blur handler isn’t working in the most simple case. I’m literally creating a div 100px by 100px and setting a blur event on it, but it’s not firing (JSFiddle):

<div id="test">this is a test</div>
$(document).ready(function() {
    $('#test').bind('blur', function() {
          alert('blur event!'); 
    });
});

Is my understanding of blur wrong? I expect the blur event to fire when I click anywhere that is not the div…right?

According to jQuery’s documentation:

In recent browsers, the domain of the event has been extended to
include all element types. An element can lose focus via keyboard
commands, such as the Tab key, or by mouse clicks elsewhere on the
page.

I’ve tried it on the latest Chrome and Firefox on Mac.

  • 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-25T17:28:45+00:00Added an answer on May 25, 2026 at 5:28 pm

    From the W3C DOM Events specification:

    focus

    The focus event occurs when an element receives focus either via a pointing device or by
    tabbing navigation. This event is valid for the following elements: LABEL, INPUT, SELECT,
    TEXTAREA, and BUTTON.

    blur

    The blur event occurs when an element loses focus either via the pointing device or by
    tabbing navigation. This event is valid for the following elements: LABEL, INPUT, SELECT,
    TEXTAREA, and BUTTON.

    The jQuery docs state browsers extended the events to other elements, which I’m guessing means blur and focus are aliases for the more generic DOMFocusIn and DOMFocusOut events. Non-input elements aren’t eligible to receive those by default though, and an element has to somehow gain focus before losing it – a blur still won’t fire for every click outside the div.

    This SO question mentions that giving an element a tabindex would allow that, and seems to work for me in Chrome after modifying your jsFiddle. (Albeit with a fairly ugly outline.)

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

Sidebar

Related Questions

Don't let below code scare you away . The question is really simple, only
I don't understand where the extra bits are coming from in this article about
Don't think that I'm mad, I understand how php works! That being said. I
I don't understand why this code doesn't work: function Messages(type,text) { console.log(In function Message);
Don't have much to say, just can get into the event handler. XAML: <Grid>
I don’t think I’ve grokked currying yet. I understand what it does, and how
Don't know why, but sometimes LocationManager is still working also after closing application. I
DON'T ASK WHY but... I have a regex that needs to be case insensitive
don't understand: in my controller: @json = User.all.to_gmaps4rails do |user| \Title\: \#{user.email}\ end in
Don't understand, if Data.Map is and [] is. I found this out while wondering

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.