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

  • Home
  • SEARCH
  • 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 8285925
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T11:35:04+00:00 2026-06-08T11:35:04+00:00

I know as of jQuery 1.7, the .live() method is deprecated. So this is

  • 0

I know as of jQuery 1.7, the .live() method is deprecated. So this is what I came up with:

$(document.body).on('click', '#list', function() {
    console.log($(this));
});

Which pretty much does the trick and is equivalent to:

$('#list').live('click', function(){
    console.log($(this));
});

They both return the #list jQuery object, which is what I wanted.
The problem is however when I pass a jQuery object as a second parameter, instead of string (which happens quite often), eg:

var list = $('#list');
$(document.body).on('click', list, function() {
    console.log($(this));
});

The console returns $(body) jQuery object. Which is useless in that point. 😉
Any ideas?

EDIT: The problem here is NOT how to access the affected object $(‘#list’) from example 1 and 2, but how to access it in example 3.

  • 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-08T11:35:05+00:00Added an answer on June 8, 2026 at 11:35 am

    A pretty clear answer you will find in the official docs:

    Use of the .live() method is no longer recommended since later
    versions of jQuery offer better methods that do not have its
    drawbacks. In particular, the following issues arise with the use of
    .live():

    • jQuery attempts to retrieve the elements specified by the selector before calling the .live() method, which may be
      time-consuming on large documents.
    • Chaining methods is not supported. For example, $("a").find(".offsite, .external").live( ... ); is
      not valid and does not work as expected.
    • Since all .live() events are attached at the document element, events take the longest and slowest
      possible path before they are handled.
    • Calling event.stopPropagation()
      in the event handler is ineffective in stopping event handlers
      attached lower in the document; the event has already propagated to
      document.
    • The .live() method interacts with other event methods in ways that can be surprising, e.g.,
      $(document).unbind("click") removes all click handlers
      attached by any call to .live()!
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

jQuery's 'live' method is unable to handle multiple events. Does anyone know of a
I bind to a link (by using the .live() function of jQuery) click event
I want to know the main difference between .live() vs. .bind() methods in jQuery.
Does anybody know how/when/why/who/where of if the JQuery intellisense files live for JQuery 1.4.2.
I know that the live() event handles event bubbling different than all other jQuery
I know in jQuery 1.4.x there is a method delay(). We can use it
I want to know How JQuery assign function name to $ ?
I see there's a new method .on() in jQuery 1.7 that replaces the .live()
I'm trying to build a jQuery.live like function. Helper is a class that has
So I know that one of the downsides of using jQuery.live is the unavailability

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.