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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T00:50:41+00:00 2026-05-15T00:50:41+00:00

Using: $(‘#foo’).data(‘events’).click We are able to access an iterative object of click handlers added

  • 0

Using:

$('#foo').data('events').click

We are able to access an iterative object of click handlers added to the element ‘#foo’ but only when they were added with .bind()

Is there a way to get the handlers for an event added with .live()?

Is there any other way to know if an element has a click handler assigned?

  • 1 1 Answer
  • 1 View
  • 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-15T00:50:42+00:00Added an answer on May 15, 2026 at 12:50 am

    live events are added to the document. Use

    $(document).data('events').click
    

    The above will return an array of objects containing information about each bound click handler. Each of these objects has a selector property containing the selector that was used at the time of binding with $(selector).live(.., ..).

    Any of these selectors that matches the element with id foo will get triggered when #foo is clicked. Note that the selector does not have to be exactly #foo for that to happen. There are many other selectors that can be used to target an element. For example if #foo was a <p>, then a live click handler such as

    $("p").live("click", function..)
    

    will also target #foo.

    Here’s one approach. Loop through each object, and see if any of the elements matching the selector property include #foo.

    var handlers = $(document).data('events').click;
    
    // jQuery quirk: $.map callback takes arguments (obj, index) and
    // $(..).map takes callback arguments as (index, obj)
    var fooClickHandlers = $.map(handlers, function(handler) {
        if($(handler.selector).is('#foo')) {
            return handler;
        }
        return null;
    });
    
    // fooClickHandlers is a list of all handlers that will fire on #foo click
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Using the navigator.geolocation object in JavaScript. Trying to establish accurate ranges, but wondering exactly
Using C# and System.Data.SqlClient, is there a way to retrieve a list of parameters
Using preview 4 of ASP.NET MVC Code like: <%= Html.CheckBox( myCheckBox, Click Here, True,
Using jQuery, one can easily find out whether a particular element is visible using
Using NSDateComponents I know how to get the day component, but this gives me
Using Android TelephonyManager an application can obtain the state of data activity over the
Using Core Data, I have a fetch request to fetch the minimum of a
Using Sql Server 2005 Profiler, what events, columns, and filters do you trace to
Using C# How can I show a document in richtextbox without scrollbars, But I
Using Xcode4.2.1, with a basic PhoneGap template based app. (I say template, but I

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.