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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T13:17:38+00:00 2026-06-14T13:17:38+00:00

i am facing problem to create clone of my firstSection (div) and paste it

  • 0

i am facing problem to create clone of my firstSection (div) and paste it on up to secondSection.

<script type="text/javascript">
   $(document).ready(function(){
        $("#firstSection").clone().prependTo("#secondSection");
   });
</script>

<table width="100%" border="1">
<div id="firstSection">
    <tr>
        <td>1</td>
        <td>1</td>
        <td>1</td>
    </tr>
    <tr>
        <td>2</td>
        <td>2</td>
        <td>2</td>
    </tr>
    <tr>
        <td>3</td>
        <td>3</td>
        <td>3</td>
    </tr>
</div>

<div id="secondSection">
    <tr>
        <td>9</td>
        <td>9</td>
        <td>9</td>
    </tr>
</div>
</table>
  • 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-14T13:17:39+00:00Added an answer on June 14, 2026 at 1:17 pm

    Firstly you can’t have div elements within a table (unless they’re enclosed within a td or th, so this is probably the result of the browser correcting invalid mark-up, however if you use tbody instead of div, it should work:

    <table width="100%" border="1">
    
        <tbody id="firstSection">
            <tr>
                <td>1</td>
                <td>1</td>
                <td>1</td>
            </tr>
            <tr>
                <td>2</td>
                <td>2</td>
                <td>2</td>
            </tr>
            <tr>
                <td>3</td>
                <td>3</td>
                <td>3</td>
            </tr>
        </tbody>
    
        <tbody id="secondSection">
            <tr>
                <td>9</td>
                <td>9</td>
                <td>9</td>
            </tr>
        </tbody>
    
    </table>
    

    Assuming you want to copy only the contents of the tbody/#firstSection element, and not create multiply-nested elements:

    $('#firstSection').clone().contents().prependTo('#secondSection');
    

    JS Fiddle demo.

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

Sidebar

Related Questions

I am facing this problem. i tried to create a function that detect if
iam facing problem in passing array to view. this is my controller code.. function
I am trying to create a karaoke-like application but I'm facing a problem. I
I am facing problem while trying to open a simple text file in C#.
I'm facing a problem while trying to create Checkboxes Dynamic in my application. The
i am using visual studio2010. i am facing a problem that when i create
Im facing following problem I have created mentioned condition, but when I choose y
I'm facing a problem that drives me crazy, I created a java application using
I'm facing a problem when I need to distribute my java application, created using
Iam facing problem in understanding and converting a matlab code into opencv. I want

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.