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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T09:21:04+00:00 2026-06-18T09:21:04+00:00

I am having 2 UL and one button <ul class=droptrue ui-sortable id=sortable1 style=min-height: 128px;

  • 0

I am having 2 UL and one button

<ul class="droptrue ui-sortable" id="sortable1" style="min-height: 128px; mozuserselect: none;"
        unselectable="on">
        <li id="article_1" class="ui-state-default">
            <input type="checkbox" id="1" />
            Article #1</li>
        <li id="article_2" class="ui-state-default">
            <input type="checkbox" id="2" />
            Article #2</li>
        <li id="article_3" class="ui-state-default">
            <input type="checkbox" id="3" />
            Article #3</li>
</ul>


<ul class="droptrue ui-sortable" id="sortable2" style="min-height: 128px; mozuserselect: none;"
        unselectable="on">
        <li id="article_4" class="ui-state-default">
            <input type="checkbox" id="4" />
            Article #4</li>
        <li id="article_5" class="ui-state-default">
            <input type="checkbox" id="5" />
            Article #5</li>
        <li id="article_6" class="ui-state-default">
            <input type="checkbox" id="6" />
            Article #6</li>
    </ul>

<input type="button" id="add" value=">>" style="width: 15px" onclick="AddToList()" />

now on button click i need to remove the corresponding li form “sortable1” and insert it into “sortable2”

I wrote the function like

function AddToList() {
        var vals = $('#sortable1 input:checkbox:checked').map(
         function() {               
             $("#sortable2").append($(this).parent().html());
             $(this).parent().remove();
             return this.id;
         }).get().join(',');                        
    }

but this function removes the li but adding only the checkbox into the other ul. if i give $(this).parent().parent().html() which adds all the li to the other ul.Please tell me what i am missing here?

  • 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-18T09:21:06+00:00Added an answer on June 18, 2026 at 9:21 am

    Use appendTo method.

     var vals = $('#sortable1 input[type=checkbox]:checked').map(function() { 
         $(this).parent().appendTo('#sortable2');
         return this.id;
     }).get().join(',');
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Assume i have four classes.Each class is having a button to do screen switching
I am having one hell of a time coming up with a decent way
I am having one heck of a hard time trying to figure this out.
I am having one problem with the PHP json_encode function. It encodes numbers as
I am having one Gtk+ and C application in which i want to set
I'm having one hell of a time trying to get my databinding to work
I'm having one doubt about the VIM ENCRYPTION key . I having a text
I am having one GtkVbox and I am adding it to GtkViewPort . View
I am having one flow field manager added on screen & in that manager
hi forum member I am having one problem with setting the radiofield in the

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.