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

  • Home
  • SEARCH
  • 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 6390929
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T03:36:32+00:00 2026-05-25T03:36:32+00:00

I want to be able to append items to an unordered list (wibble) when

  • 0

I want to be able to append items to an unordered list (wibble) when an item is selected from a larger list (user_checkboxes). If a user clicks on an item in the ‘wibble’ list I would like to remove that item from the list.

The problem I am having is that the list items ‘a’ and ‘b’ work as I was hoping. i.e if i click on the list item they are removed from the list. Unfortunately any items that are added to the list by append don’t behave the same way. i.e They don’t get selected and removed from the list.

<ul class = "wibble">
<li>a</li>
<li>b</li>  
</ul>


$(document).ready(function () { 
  $(".user_checkboxes").change(function() {
     if ($(this).attr("checked")) {             
        $('.wibble').append('<li>'+newListItem+'</li>');
     }
  }
  $('.wibble li').click(function() {
     $(this).remove();
  );
}
  • 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-25T03:36:33+00:00Added an answer on May 25, 2026 at 3:36 am

    When you bind the click event handler, the list elements don’t exist yet, so jQuery cannot bind any handlers to them.

    Use .delegate() [docs] instead:

    $('.wibble').delegate('li', 'click', function() {
        $(this).remove();
    });
    

    This binds an event handler to .wibble (which does exist) and listens to any click that originates from a descendant li element.

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

Sidebar

Related Questions

So, to simplify my life I want to be able to append from 1
I want to be able to generate PDF output from my (native) C++ Windows
I want to be able to append divs to my page such that they
I've got a list of integers and I want to be able to identify
I am using a treeview with checkboxes. I want the user to be able
I'm using Zend_view/Zend_Layout but i want to be able to append scripts to the
I want to be able to save the email and password of the user
I want to be able to do: def update_profile(request, username): user = Profile.objects.get(user__username=username) #
I'm using LaTeX and BibTeX for an article, and I want to able to
Want to be able to provide a search interface for a collection of objects

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.