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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T04:05:09+00:00 2026-06-15T04:05:09+00:00

I want to catch inward type events and do ABC , and catch outward

  • 0

I want to catch “inward” type events and do ABC, and catch “outward” type events to do XYZ. I’m getting problems with the various events firing at weird times that I didn’t expect, so I’m wondering if my approach is actually causing the problem.

<div class="box">first box</div>
<div class="box">second box</div>

$(".box")
  .on("focus mouseover mousedown", function(){ /* do ABC */ })
  .on("blur mouseout mouseup",     function(){ /* do XYZ */ });

I think that stringing the .on() methods together like this makes sure that the blur event is only triggered for that same .box. But other than that, I expect it behaves identically to if I did it this way:

$(".box").on("focus mouseover mousedown", function(){ /* do ABC */ });
$(".box").on("blur mouseout mouseup",     function(){ /* do XYZ */ });

or doing something like this: (which seems redundant)

$(".box").on({
  focus:     function(){   /* do ABC */ },
  mouseover: function(){   /* do ABC */ },
  mousedown: function(){   /* do ABC */ },

  blur:      function(){   /* do XYZ */ },
  mouseout:  function(){   /* do XYZ */ },
  mouseup:   function(){   /* do XYZ */ }
);

I’m not asking “which is better” but rather, “how are they different”? They seem to be getting different results.

  • 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-06-15T04:05:12+00:00Added an answer on June 15, 2026 at 4:05 am

    They’re different in the sense that your jQuery selector $(".box") only runs once, so chaining them is more efficient. Functionally they’re identical.

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

Sidebar

Related Questions

I want to catch an exception, that is nested into another exception. I'm doing
I want to catch duplicates mutually exclusively, that is, I need to show that
I want to catch MouseDown events for all cells of the DataGrid object. I've
i want to catch all click events except if they are done on a
I want to catch bracket/parenthesis pairs that are next to each other and get
If I want to catch events on clicking RMB on Col1 and Col2, and
I want to catch the event that user clicks and holds mouse on a
I have a SplitContainer I want to catch the Panel2 collapsing and expanding events.
I have a WPF program that I'm developing in which I want to catch
I want to catch clicks that occur anywhere in an iframe. I can not

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.