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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T16:47:56+00:00 2026-05-15T16:47:56+00:00

I am using Jquery to dynamically add some HTML into a page. Now this

  • 0

I am using Jquery to dynamically add some HTML into a page.

Now this new HTML code should trigger additional Jquery functions to enable more processing to be done but this new HTML code isnt recognized and thus the additional Jquery functions arent triggered.

How can I get the new HTMl code to be recognized and the additional functions triggered?

Thanx

  • 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-15T16:47:56+00:00Added an answer on May 15, 2026 at 4:47 pm

    There are 2 concerns normally, event handlers and plugins, which are two different things.


    Part 1: Event Handlers

    Event handlers are easy, because they act upon events, events behave identically no matter when the element as added. For this there’s .live() and .delegate(), .live() listens for events on document and runs if an event comes from an element that matches the selector, let’s take a table row for example:

    $("tr").click(function() { ... });
    

    This would find all current table rows, when it ran and bind a click event handler to them, the same as .bind('click', function). Then there’s .live(), like this:

    $("tr").live('click', function() { ... });
    

    This listens for the click event to bubble up to document (this happens automatically, by default) and executes the handler…current and future elements behave the same way here. This means it works for both. Then there’s .delegate() which is a local version of .live() like this:

    $("#myTable").delegate('tr', 'click', function() { ... });
    

    If you’re just adding rows to #myTable but not removing/adding the table itself, the same type of listener for bubbling events can sit there, instead of all the way up on document, this means the event has to bubble fewer times before reaching the handler you want to execute.


    Part 2: Plugins

    Plugins are a bit trickier, because they take elements and do things with them (this is true for most plugins). You have two decent options here, either running the plugin when new elements yourself, for example loading via $.ajax() or a shorthand version would look like this:

    $.ajax({
      //options...
      success: function(data) {
        //add elements
        $("tr", data).myPlugin();
      }
    });
    

    This finds new <tr> elements, but only in a local context (in the returned HTML) and executes only on those elements. Alternatively, there’s a plugin for this, less efficient, but usually not a noticeable difference on most pages. The .livequery() plugin actively looks for and acts up new elements, the same code would look like this:

    $("tr").livequery(function() {
      $(this).myPlugin();
    });
    

    Either of these are valid solutions, just see which fits your needs better.

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

Sidebar

Related Questions

In html page some tags are dynamically created using jquery and contents are loaded
I'm using jQuery to dynamically add new divs containing a few fields. I'm adding
I am using the Jquery table addrow plugin to add row dynamically, the code
When using jQuery.load to dynamically load HTML content into a webpage, what is the
I've a table generated dynamically by jQuery, using this.html("<table><tr><td><div>Click Me</div></td></tr></table>"); within the table, I've
I'm using jQuery.append() to add some elements dynamically. Is there any way to get
Using jQuery 1.7 I'm having trouble binding a Click event to some dynamically loaded
I have a page that dynamically creates (using jQuery) Input boxes for the user.
I'm developing a web page using django and I want to add some javascript
I'm building some <table> data dynamically using jQuery, but I'm getting the following error:

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.