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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T01:37:24+00:00 2026-05-28T01:37:24+00:00

I have been looking for a function in jquery that will let me just

  • 0

I have been looking for a function in jquery that will let me just “copy and paste” the text within a certain element, i.e. a <li> or inside a <div> and put it into another element. This should be done without destroying the element that the text is being copied from.

I have a jsfiddle document which demonstrates my best attempt and a more practical description: http://jsfiddle.net/HDBLd/

Thanks very much.

P.S I would like to clarify that I don’t want the text inside the element to be copied to the users clipboard, just copied to the other element.

  • 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-28T01:37:25+00:00Added an answer on May 28, 2026 at 1:37 am

    To send the HTML from one element to another you can simply use the html() output from the original element as the source for the target, like this:

    jQuery($ => {
      $('li').on('click', function() {
        $('#lorem').html($(this).html());
      });
    });
    <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.3/jquery.min.js"></script>
    <div id="lorem">
      This is the text that should change
    </div>
    
    <div id="impsum">
      <ul>
        <li>This is the text that will replace the other piece of text. I need to find a function that will just copy the text in here - not the whole li with the bullet as well.</li>
      </ul>
    </div>

    Note that you can also use text() instead of html() if you want to ignore any HTML inside the original element.

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

Sidebar

Related Questions

I have been looking for a really good, well documented jquery plug-in that will
I have been looking for awhile, and I am just too new with JQuery
I've been writing some jQuery functions that have JavaScript variables and looping, etc inside
Have been looking at the MVC storefront and see that IQueryable is returned from
I have been looking at jQUery thickbox for showing modal dialogs with images, it
I'm looking at transferring existing functionality (built with PrototypeJS) to jQuery and have been
I have been looking at the YouTube Insight function and want to learn how
Can't get my head around this Jquery problem I have.. I've been looking around
I have a question concerning functions with jQuery. I have a function that once
I've been looking for something that will authorize a textbox when user types something

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.