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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T12:26:42+00:00 2026-06-14T12:26:42+00:00

I am messing around with some code, and I have a list which I

  • 0

I am messing around with some code, and I have a list which I have applied the draggable function to, and another div with a drop function.

what I am trying to achieve is when the list element is dropped it is removed from the parent list and added to another list.

here is the code I was playing with:

    <div id='dAvail'>
<ul>
    <li><div class='abox'>1</div></li>
    <li><div class='abox'>2</div></li>
</ul>
</div>
<div id='somewhereToDrop'>
</div>
<div id='newListHere'>
<ul>
</ul>
</div>

the JS:

$(document).ready(function(){
//add the droppable function to the divs in main list
$('#dAvail ul).each(function(){
   $('li>div).draggable();
});

$('#somewhereToDrop').droppable({
   tolerance:'touch',
   drop:function(event,ui){
   //this is where I am having problems.
   //if I do ui.draggable I get an object representing the object I dragged but not 100% how to remove said object from the orginal list to then append to the new one.
   //this is what i tried.
   var t = ui.draggable[0]; //represents the div that i dropped.
   $(t).parent().parent().remove($(t).parent());
   //that is as far as I have gotten as this returns an error


});

if anyone could point out how to get to remove that object from the list it would be great.
I even tried to see if I could do $(t).parent().eq() but that did not work, the idea was to get the list index then remove it like that.

thanks

  • 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-14T12:26:44+00:00Added an answer on June 14, 2026 at 12:26 pm

    remove() does not take a parameter. It removes its instance from the DOM. So, really, all you want to do is:

    $(t).parent().remove();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am currently messing around with some code for an advertising network, i have
I have been messing around with writing some stored procedures in .NET code with
The situation is that I've spent some time messing around with some experimental code.
I have finally started messing around with creating some apps that work with RESTful
I'm messing around in Ruby some more. I have a file containing a class
I have some code in a function that goes something like this: void foo()
I have been messing around with web.py lately and wanted to grab some stuff
Messing around with some CSS trying to learn some stuff as I haven't done
I have a list with some strings (most of which I fetched from a
I am messing around with some Javascript game development, trying to create a simple

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.