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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T07:55:52+00:00 2026-05-27T07:55:52+00:00

I have this problem I’m working on which is giving me a headache, because

  • 0

I have this problem I’m working on which is giving me a headache, because I can’t seem to find where the bug is. Here’s the markup:

<div class="excerpt">
     <p>...</p>
</div>

<div class="bio">
     <p>...</p>
</div>

When the user clicks a button, I want to display whatever is in div.bio to show in div.excerpt. Here is my click() function.

$('.button').click( function() { 
     var bio = $('.bio p'); 
     var excerpt = $('.excerpt'); 

     // empty 
     excerpt.empty(); 

     // replace
     bio.appendTo(excerpt); 

}); 

The problem is that this code removes the paragraphs from the bio during the append. Is there a way to simply append and not remove the elements from the source? Or am I doing something else wrong?

  • 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-27T07:55:53+00:00Added an answer on May 27, 2026 at 7:55 am

    When you use append or appendTo on existing parts of the DOM tree you are actually moving them. As the documentation states,

    If an element selected this way is inserted elsewhere, it will be
    moved into the target (not cloned):

    You need to also use clone to add a copy of the elements to the tree. For example:

    bio.clone().appendTo(excerpt);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have this problem that i can't solve for days now...here is my code.
I have this problem which i find a bit difficult to explain but I
i have this problem to find a particular xml node l have post this
have this problem with PCACompute in Android Opencv2.3.1 because when i call PCACompute my
I have this problem where I have created a User Control which mimics a
i have this problem: as i can add list to one list? i have
I can't be the first person to have this problem, I must be missing
I have this problem with CSS round corners. The link to example is here:
I have this problem with codemirror which is quite tricky and I have no
i have this problem: user can add an HTML description and it will be

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.