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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T16:09:01+00:00 2026-05-26T16:09:01+00:00

My application has dynamically added Dropdowns. The user can add as many as they

  • 0

My application has dynamically added Dropdowns. The user can add as many as they need to.

I was traditionally using jQuery’s live() method to detect when one of these Dropdowns was change()ed:

$('select[name^="income_type_"]').live('change', function() {
    alert($(this).val());
});

As of jQuery 1.7, I’ve updated this to:

$('select[name^="income_type_"]').on('change', function() {
    alert($(this).val());
});

Looking at the Docs, that should be perfectly valid (right?) – but the event handler never fires. Of course, I’ve confirmed jQuery 1.7 is loaded and running, etc. There are no errors in the error log.

What am I doing wrong? Thanks!

  • 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-26T16:09:01+00:00Added an answer on May 26, 2026 at 4:09 pm

    The on documentation states (in bold ;)):

    Event handlers are bound only to the currently selected elements; they must exist on the page at the time your code makes the call to .on().

    Equivalent to .live() would be something like

    $(document.body).on('change', 'select[name^="income_type_"]', function() {
        alert($(this).val());
    });
    

    Although it is better if you bind the event handler as close as possible to the elements, that is, to an element being closer in the hierarchy.

    Update: While answering another question, I found out that this is also mentioned in the .live 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+
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Our application has many controls that are created dynamically. For example, a navigation pane
My application has a need to let the user choose a date from a
My application has a module which allows the user to add jButtons on the
My application has a button to execute a python script dynamically using execfile .
My application has a command line interface, and I'm thinking about using the GNU
My application has just started exhibiting strange behaviour. I can boot it through the
I'm working on an ERP application where multiple inventories need to be dynamically supported,
I have a WPF application that I'm trying to dynamically add items to a
In my ASP.NET application, I am loading an .ascx dynamically using LoadControl, using the
I have developed a plugin. The plugin has a declaration that can be added

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.