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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T00:50:36+00:00 2026-05-19T00:50:36+00:00

I have have a a function that when a checkbox is checked i dynamically

  • 0

I have have a a function that when a checkbox is checked i dynamically write out an li into a ol that is empty.

Code:

$(":checkbox").click(function() {
    var checkedState = $(this).is(':checked');
    if (checkedState == true) {
       var productName = $(this).attr("title");
       $("#selectedProductsList").append("<li class=\"productList " + this + "\"><p class=\"removeIcon\"><img src=\"images/remove-icon.png\" alt=\"Remove Product\" /></p><span class=\"productName\">"+ productName +"</span></li>");
    };
});

Then when that writes out there is a remove icon that will remove the item from the ol when clicked. This remove icon has a class of removeIcon which can be seen in the dynamic li above.

I have a function that processes the remove call and then does some actions:
Code:

$('.removeIcon').click(function() {
 alert("starting");
});

Right now i have the remove action just trying to alert a message that it got called. But it seems that it is not getting into the function.

Is there a certain way that i need to access these dynamic li’s other then the .click method? I saw this post:
Dynamically Inserted DOM Elements are not Clickable using $.click()

Where they added .live vs .click but this doesn’t seem to work either.

Any ideas?

  • 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-19T00:50:37+00:00Added an answer on May 19, 2026 at 12:50 am

    try using the live event…

    $(".removeIcon").live("click", function () {
        alert("starting");
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have that function: $(#tabela tr).toggle(function(){ $(this).addClass(zaznaczone); $(this).find( :checkbox).attr(checked, 1); },function(){ $(this).removeClass(zaznaczone); $(this).find( :checkbox).attr(checked,
I have a checkbox that calls a javascript function. When this checkbox is checked,
Ok, so I have this jquery function to that grabs the checkbox's value and
I have a function with the following code that binds a table dynamically. I
I have a javascript function that goes something like this: function doSomething(me) { var
I have this html @foreach (var item in Model.Options) { <input type=checkbox checked=checked name=selectedObjects
I want to have a jquery function that will be activated when any checkbox
In my Java code I have function that gets file from the client in
I have function Start() that is fired on ready. When I click on .ExampleClick
I have a function below that I want to trigger only when a checkbox

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.