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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T00:40:57+00:00 2026-05-28T00:40:57+00:00

I have a live() function in my jquery below: $(#qandatbl td.weight input).live(change, calculateTotal); function

  • 0

I have a live() function in my jquery below:

$("#qandatbl td.weight input").live("change", calculateTotal);

function calculateTotal()
{
   var totalweight = hundred;
   $("#qandatbl td.weight input").each(function (i, elm){
        totalweight = totalweight - parseInt($(elm).val(), 10);
    });

    $("#total-weight").text(totalweight).append('%').css('font-weight', 'bold');
}

Now some people say that the live() function is slowing fading away and that is better to use the on() function. If this is true then how do I change the code above to on() function rather than a live() function? Is it important I don’t use live() or does it not really matter that much?

  • 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-28T00:40:58+00:00Added an answer on May 28, 2026 at 12:40 am

    According to the documentation:

    Rewriting the .live() method in terms of its successors is straightforward; these are templates for equivalent calls for all three event attachment methods:

    $(selector).live(events, data, handler);                // jQuery 1.3+
    $(document).delegate(selector, events, data, handler);  // jQuery 1.4.3+
    $(document).on(events, selector, data, handler);        // jQuery 1.7+
    

    So in your case, if you’re using jQuery 1.7+, it would be:

    $(document).on('change', '#qandatbl td.weight input', calculateTotal);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this js code: $(#startSearch).live(click, function(event) { $(input:checkbox[name='searchId']:checked).each(function() { var searchId = $(this).val();
I have read the documentation of each function on jQuery official website , but
I have a problem of jQuery's live() function not working with click, mousedown but
Currently I have the below jQuery which uses the colorbox plugin http://colorpowered.com/colorbox/ $(document).ready(function(){ $(.altbgcolor).hover(function()
I have the following bit of code, simply: $(function() { $('a.add-photos-link').live('click', function(e) { $(this).colorbox({
i have the following block of code: $(#contact_container form, #contact_details form).live( submit, function(event) {
so I have this jQuery script below that works. But since I'm just learning
I'm making table rows click-able with jQuery's $.live() function. Works perfectly on Chrome, Firefox
I have a jquery that has first server function call using post and next
I have a button in a jQuery tabbed page declared like this: <input id=buttonSave

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.