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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T03:16:57+00:00 2026-06-06T03:16:57+00:00

I have created a jqueryUI drag drop list. Now, i need to remove an

  • 0

I have created a jqueryUI drag drop list. Now, i need to remove an object from it. I have used the following function for it:

function remove(el) {
$(el).hide();
$(el).parent().parent().effect("highlight", {color: "#ff0000"}, 1000);
$(el).parent().parent().fadeOut('1000');
setTimeout(function() {
    $(el).parent().parent().remove();
    });
}

And this is the code(the remove(this) function) through which this function is executed:

var html = '<div class="item i">';
html = html + '<div class="divrm">';
html = html + '<a onclick="remove(this)" class="remove '+itemid+'">&times;</a>';
html = html + '<div/>'+item+'</div>';

Suppose I have an element like this:

<div class="item" id="i2">
<img src="img/2.jpg"/>
<label class="title">Title</label>
<label class="weight">Heavy</label>
</div>

Now in the remove function, i need the text between the label having “.title” class. How can i do that? I have tried this but it does not seem to be working:

var remtitle = $(el).parent().parent().find(“.title”).val();

What am i doing wrong? I am fairly new to jquery so it might be an amateur mistake.

  • 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-06T03:16:58+00:00Added an answer on June 6, 2026 at 3:16 am

    Use html() or text() instead of val() since a lable isn’t an input type:

    var remtitle = $(el).closest('.item').find(".title").html();
    

    Notice that addition of closest() function also, it helps find a parent easily rather than using parent() again and again. Also make sure to put your code in jQuery ready() handler.

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

Sidebar

Related Questions

I have created 3 classes as following Ext.mine.TextParent - Inherting from Textfield Ext.mine.child.TextChildA -
I've just started learning javascript and have created a drag and drop using jquery
I have a horizontal jquery-ui drag drop list contained in a wrapper in which
I have created a jQuery script to drag elements over the document. I done
I have created a custom form class and template for my form by following
I have used jQuery UI library to drag divs within a web page. While
I have a drag and drop script using an older version of jquery which
I have created a django application. In my application i have a registration from
I have a problem with jQuery-UI sliders ( http://jqueryui.com/demos/slider/#default ). I've created a couple
I have a jQueryUI datepicker, which was created with dateFormat: 'dd/mm/yy'. If I use

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.