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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T11:47:24+00:00 2026-05-31T11:47:24+00:00

I know it’s not possible to bind to all DOM events and I know

  • 0

I know it’s not possible to bind to all DOM events and I know you can bind to multiple events by supplying a space-separated list.

But is it possible to bind to all custom events (preferably filtered by a wildcard pattern like ‘abc*’ or name-space)?

Edit:
To clarify, I have created some custom widgets that respond to some custom events. For example, they all handle an event called stepReset and resets their internal models.

After I’ve written these, I realized events don’t bubble down, so the call $(body).trigger('stepReset') basically does nothing. As a result, I am considering adding an umbrella event handler on all widgets’ parent elements to propagate all relevant events down.

(I know this is not an elegant solution, but I forgot to tag elements with handlers with a common class, so there’s no easy way to use select them all.)

  • 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-31T11:47:25+00:00Added an answer on May 31, 2026 at 11:47 am

    With regards to your upcoming edit, you can retrieve all bound events by accessing the object’s data:

    var boundEvents = $.data(document, 'events');
    

    From here, you can iterate over the resulting object and check each property for your chosen wildcard character, or iterate over that property’s array elements and check the namespace property of each.

    For instance,

    $.each(boundEvents, function () {
        if (this.indexOf("*"))   // Checks each event name for an asterisk *
            alert(this);
    
        // alerts the namespace of the first handler bound to this event name
        alert(this[0].namespace); 
    });
    

    If I understood you correctly, you can iterate over the special events object to get a list of custom events (including those specified in the jQuery source code). Here’s an ES5 example, you will need to adapt it yourself for older browsers or use a polyfill for Object.keys:

    var evts = Object.keys(jQuery.event.special).join(" ");
    $("#myDiv").on(evts, function (e) {
        // your code here
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I know that it's a subject that can raise a lot of debate, but
I know regex and substrings is a common question on here but i can
I know the title isn't informative at all, but I had no idea how
I KNOW I did this in WP7 (not WP7.1) and I can't figure out
I know C# can manage resource pretty well with its garbage collector. But since
I know there are many topics with similar issues, but I have not been
I know we can trigger an Intent.ACTION_SEND intent to send email. But according to
I know its probably possible, but is it practical and doable to try and
I know its probably possible, but is it practical and doable to try and
I know you can minify/condense Javascript or CSS code, but can you do this

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.