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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T18:27:45+00:00 2026-06-17T18:27:45+00:00

I have hundreds of <button class=lb> <div class=l></div> <div class=c>2</div> <div class=r></div> </button> which

  • 0

I have hundreds of

<button class="lb">
  <div class="l"></div>
  <div class="c">2</div>
  <div class="r"></div>
</button>

which a few are already in the DOM when the page is loaded and others are added dynamically through javascript.

When someone clicks on the button, the value inside the div class=”c” inside of the button should be heightened by 1.

I thought I could do that like this

$(".lb").on("click", function(event) {
  $('.c', this).html(parseInt($('.c', this).html()) + 1);
  $(this).unbind('mouseout');
});

but that does only work on the elements that are loaded on pageload and not on the new per-JS-inserted ones.

I can’t find what I’m missing and would appreciate any hint.

Thanks!
Raphael

  • 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-17T18:27:47+00:00Added an answer on June 17, 2026 at 6:27 pm

    You are missing a few concepts of using .on() as a delegate:

    $(' --CONTEXT-- ').on('click', ' -- YOUR ELEMENT -- ', function () {
    
    });
    
    // like-wise to "unbind" using the new methodology
    // you would use .off()
    $(' --CONTEXT-- ').off('click', '-- YOUR ELEMENT --');
    

    So to put it in example form:

    $(document).on('click', '.lb', function () { });
    

    But of course this makes the context (or where it will be “bubbling up towards”) document which is too high up. Try using a large parent surrounding wherever this item may appear, it will speed up performance.

    $('#someParent').on('click', '.lb', function () { });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following markup (this is an example there are hundreds) <div class=Q3>
We have a database of hundreds urls which we want to show similar content
I have an excel spread sheet (well, hundreds of them) which I need importing
I have a page with a button. When clicked, a php script is executed
We have created a multi-threaded application which process/parse big files (few hundred MB's) simultaneously.
I have a div that contains hundreds of lines. I want to create a
I have hundreds of lines to parse. They are like: key1 = $global.path key2
i have hundreds of [mostly different] files in many different directories that all have
We have hundreds of document libraries, spread all throughout various site collections in a
I have an application that can potentially have hundreds of memory mapped, i.e., mmap()

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.