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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T13:56:35+00:00 2026-05-26T13:56:35+00:00

Can someone please explain the structure of this line of a script for me?

  • 0

Can someone please explain the structure of this line of a script for me? Another user on here has written it as part of a function that I know want to edit and change to use elsewhere on my site.

    $('#main_content .img-wrapper').empty().append($(this).find('img').clone());

This one takes an image from one div and copies it to another with the class=”img-wrapper”

I want to do exactly the same but with text. I tried this

$('#main_content .text-wrapper').empty().append($(this).find('.info').clone());

where (‘.info’) is the class name of the div I want to copy. Its not working.

I don’t fully understand the syntax as this is my first day using javascript. Please can someone explain where I’m going wrong?

This is the HTML – There are four different images and when the user clicks on each of the image I want it to load the same image and associated text in the main content div

    <div class="row">
<div class="card-container">
  <div class="card">
    <div class="back">
      <img src="images1.png" />
      <div class="info" style="display: none;">This is a test for image one</div>
    </div>
    <div class="front"  style="background-color:#cc99cc;"></div>
  </div>
</div>

<div class="card-container">
  <div class="card">
    <div class="back">
      <img src="images2.png" />
      <div class="info" style="display: none;">This is a test for image one</div>
    </div>
    <div class="front"  style="background-color:#9966cc;"></div>
  </div>
</div>

<div class="card-container">
  <div class="card">
    <div class="back">
      <img src="images3.png" />
      <div class="info" style="display: none;">This is a test for image one</div>
    </div>
    <div class="front"  style="background-color:#6666cc;"></div>
  </div>
</div>

<div class="card-container">
  <div class="card">
    <div class="back">
      <img src="images4.png" />
      <div class="info" style="display: none;">This is a test for image one</div>
    </div>
    <div class="front"  style="background-color:#3366cc;"></div>
  </div>
</div>

This is the main content div

<div id="main_content">
  <!-- main content -->
  <div class="img-wrapper">
  </div>
  <div class="text-wrapper">
  </div>
</div>  
  • 1 1 Answer
  • 1 View
  • 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-26T13:56:37+00:00Added an answer on May 26, 2026 at 1:56 pm

    Try this:

    $('#main_content .text-wrapper').empty().append($(this).find('.info').html());
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Can someone please explain to me why this simple assignment doesn't work. Here is
Can someone please explain what is going on here with the Django Tutorial Part
Can someone please explain what this line of jquery means in tooltip(used by popover)
Can someone please explain to me why does COMMIT in this function returns EXCEPTION
Can someone please explain this piece of code? struct Class { boost::function<void()> member; };
Can someone please explain to me how this responsive approach works? This was done
Can someone please explain this phenomenon? I am using Mojarra 2.1.6 - Glassfish 3.1.2.
Can someone please explain what really goes on in this code ? If I
Can someone please explain how this code is working for me? I don't understand
Can someone please explain why this doesn't work? MyClass myClass1 = new MyClass(); object

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.