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

The Archive Base Latest Questions

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

With the newer jQuery .click() , .submit() , etc. was replaced by: $(‘#foo’).on(‘click’, function()

  • 0

With the newer jQuery .click(), .submit(), etc. was replaced by:

$('#foo').on('click', function() {
    //
});

in terms of best practice. Did anything similar happen to .live()? Or is this still the best way to do it?

$('#foo').live('click', function() {
    //
});
  • 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:42:39+00:00Added an answer on June 15, 2026 at 4:42 am

    On() has all the abilities of all other bindings. To bind to dynamic elements you can use on() like this:

    $(document).on('click', '#foo', function() {
        //
    });
    

    Preferably you want to use a close static element instead of document.

    To quote from another post of mine regarding the many binding methods jQuery has on offer:

    bind() was added in 1.0, live() in 1.3, delegate() in 1.4.2 and
    on() in 1.7.

    As of 1.7 on() is the preferred use and live() is deprecated and
    not recommended at all. If you are using 1.3 use bind() instead of
    live() and as of 1.4.2 use delegate() instead of live() and as of
    1.7 use on() instead of any of the others.

    You can see the full post here, which also list the many drawbacks of live() and why it should not be used any more in jQuery 1.7 or later.

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

Sidebar

Related Questions

I have a click function in jQuery and it never seems to execute. I
I have a jQuery function that shows a 'loading' image and disable the submit
Never ran into this problem with jQuery before. I have the following: $(document).ready(function() {
Greetings all, I have a simple JQuery function which is bound to an ASP:Button
i´m new developing on asp.net mvc, and even newer using jquery, so this is
I am trying to perform the following fadeIn/fadeOut action within the jQuery $.post function.
I'm having an issue submitting a form with jQuery's submit() . I don't have
I'm using Jquery to submit a form. I want to loop through the form
I have the following jQuery: var fn = { Load: function () { $(.myclass
newer to javascript. On my page (asp.net application, vb as serverside language), I am

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.