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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T03:28:51+00:00 2026-05-30T03:28:51+00:00

I have drag and drop function with jquery. Dragging and dropping div inside this

  • 0

I have drag and drop function with jquery. Dragging and dropping div inside this div tag there is few one image and two label how i can text in dropped div with label class?

Div:

 <div id="list_item" class="dragable">
                    <asp:Image ID="Image1" Height="50" Width="50" ImageUrl='<%# Eval("ProfilePicture")%>'
                        runat="server" />
                    <label id="list_item_username" class="friend_user_name">
                        <%# Eval("FriendUserName")%>
                    </label>
                    <label id="list_item_ranknumber">
                        <%# Eval("RankNumber")%></label>
                    <label id="list_item_rankname">
                        <%# Eval("RankName")%></label>
                </div>

this my jquery:

 $("#clan_drop").droppable({
    accept: ".dragable",

    drop: function (ev, ui) {

        UserCount++;

        if (UserCount > 10) {
            alert("You cannot add more users. Maximum quantity of gamers in one clan is 10");
        } else {

            $("#drag_here_container").css("display", "none");
            var droppedItem = $(ui.draggable).clone();
            $(this).append(droppedItem);
            var user = $(this).find('.friend_user_name').text();

            if ($.inArray(user, UsersList) > -1) {

                $('.dragable:last').remove();
            } else {

                UsersList.push(user);
                SendUserToC(user);
            }
        }
    }
});

this is what fire bug shows on var user:

enter image description 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-05-30T03:28:53+00:00Added an answer on May 30, 2026 at 3:28 am

    text() method will get all the space and new line characters within the dom element. If you don’t want it then you can use jQuery’s trim method.

    var user = $.trim($(this).find('.friend_user_name').text());
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have done drag and drop work using with jquery plug-in, Jquery: $(document).ready(function() {
I want to do a simple drag-drop using jQuery. I have not done anything
I have a problem: I've add a Jquery UI drag-n-drop widget to my page,
I want to enable drag-and-drop behaviour on my Web application. I have an image
I'm trying to have both mouseover events and drag-and-drop using JQuery and JQuery UI.
i have done drag and drop using with jquery. here i have issue that
I have two li elements which are jQuery draggable. When I drag and drop
I've just started learning javascript and have created a drag and drop using jquery
I have a drag and drop handler in my Flex application. The drag proxy,
I have created a nested list with drag/drop functionality. My issue is that I

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.