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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T22:03:49+00:00 2026-05-27T22:03:49+00:00

Hello there Iam using Jquery 1.6.2 and JqueryUI 1.8.16 I have a sortable list

  • 0

Hello there Iam using Jquery 1.6.2 and JqueryUI 1.8.16
I have a sortable list with JqueryUI.Each Li item has a button (with x) which removes the current li item from the list. Also I use a dialog box to add more li items to the ul list. All though my project works well on the initisialisation after appending the new li items the remove buttons don’t work on the appended items don’t work, the ones that are in first work fine, the sort options work fine too.
here is my code

$.noConflict();
jQuery(document).ready(function($) {
//the sortbale list init
$( "#sortable" ).sortable({
  placeholder: "ui-state-highlight"
});

//when a remove button with class .remo is clicked remove the parent li
$( ".remo" ).click(function() {
            $(this).parent().remove();
        });

//and the dialog to add more li items
$( "#dialog" ).dialog({
            autoOpen: false,
            height: 500,
            width: 550,
            modal: true,
            show: "blind",
            hide: "explode",
      buttons: {
                Add: function() {
                 if($("#mark").val()!="" && $("#series").val()!="" ){
         var addme =   "<li >a new li item <div class='remo'>x</div></li>";
                   $("#sortable").append(addme);
                    $( this ).dialog( "close" );
                                           }
                },
                Cancel: function() {
                    $( this ).dialog( "close" );
                }
            } 

        });

});//end of dom ready

And my html code

<div id="dialog" title="Manage ul ">
<b>Click add for a new one</b><br>
</div>
<!--and the sortable list-->
<ul id="sortable" style="list-style-type: none;margin: 0;padding: 0;">
        <li>Li 1 <div class="remo" >x</div></li>
    <li >Li 2 <button class="remo">x</button> </li>
    <li >Li 3 <button class="remo" >x</button> </li>
</ul>

Any suggestions?

  • 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-27T22:03:50+00:00Added an answer on May 27, 2026 at 10:03 pm

    Event handlers (when bound with click or bind) are only applied to elements currently matching the selector.

    Use delegate (in jQuery < 1.7) or on (jQuery >= 1.7) to bind event handlers to elements that match the selector now or in the future. So using delegate in your case:

    $("#sortable").delegate(".remo", "click", function() {
        $(this).parent().remove();
    });
    

    Example: http://jsfiddle.net/bzKzs/

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

Sidebar

Related Questions

I have three button named(titled) hello, nothing, heaven and one label (IBOutlet UIlabel lab).
I am working on a jQuery-based todo list interface, and have hit a bit
I am using jQuery UI 1.8 and have the following code: var newDiv =
I am using jQuery UI dialog for modal popups. I have some iframes in
I have a hello-world style java ee application using maven3 glassfish3 and javaee6. I
Hello I have a Binding that I am using along with a converter, I
I am using iOS SDK 4.2 and followed this tutorial: http://mobileorchard.com/hello-there-a-corelocation-tutorial/ , and got
Hello I am using jquery-ui tabs on a page that is being embedded into
Hello can anyone help? I am using this full page slider.. http://www.musca.se/full-window-width-jquery-tools-content-slider-demo/ However i
I am using Rails 3, Jquery-UJS and Jquery. I have a working setup of

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.