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

  • Home
  • SEARCH
  • 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 8864675
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T16:18:11+00:00 2026-06-14T16:18:11+00:00

Hi all i am working on jquery here i have a html code like

  • 0

Hi all i am working on jquery here i have a html code like this

<div>
    <span class="span1">
      <label class="checkbox" />
          <input type="checkbox" class="regular-checkbox" id="Header" />
          <label for="Header"></label>
      </label>
    </span> 
    <span class="span1">Images</span> 
    <span class="span1">SKU</span>
    <span class="span2">Name</span> 
    <span class="span1">Price</span>                             
</div>

<div id="separate"></div>
      <input type="button" id="button" />

i had tried like this it dosen’t works

<script type="text/javascript">
    $(document).ready(function(){
    $(#button).click(function(){
   $(function () {

      $("input:checkbox").toggle(function () {
         $("#Header").appendTo("#separate");
      },function () {
         $("#separate").appendTo($(this));
      });
      });

   });
</script>

i have this DIV in which i have a checkbox from here i have an image, price and name (cell phone). This is my code and i have a ‘href’ icon
when i select the checkbox, and i submited the image and price and name should move to another DIV how can I do this and when i deselect the checkbox?
It should toggle. Could u please help me on how to fix this, thanks in advance.

  • 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-14T16:18:14+00:00Added an answer on June 14, 2026 at 4:18 pm

    This is how I would do it. http://jsbin.com/umivoc/1/

    JavaScript:

    $(function () {
      // Check if user clicks on the checkbox
      $("#Header").click(function() {
    
        if($('#Header').is(':checked')){
    
          // If the checkbox becomes checked, 
          // move the contents to our new div (div2)
          $("#div1").contents().appendTo("#div2");
        } else {
    
          // Otherwise we can assume it is being unchecked, 
          // so move everything back to it's original div (div1)
          $("#div2").contents().appendTo("#div1");
        }
      });
    });
    

    HTML Markup:
    I cleaned up your markup quite a bit, you had open label tags, and you should probably put the elements you want to move inside their own wrapper div, to make things easy.

    <span class="span1">
       <label for="Header"></label>
       <input type="checkbox" class="regular-checkbox" id="Header" />
    </span> 
    <div id="div1">
       <span class="span1">Images</span> 
       <span class="span1">SKU</span>
       <span class="span2">Name</span> 
       <span class="span1">Price</span>                             
    </div>
    <div id="div2"></div>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hi all i am working on jquery here i have my html like this
Hi all i am working on jquery here i have my html like this
I have a generated HTML menu that looks like this : <ul class=principal-nav> <li><a
I have a a nice jquery slide down effect working here: http://georgedesign.co.uk/test/markupV2/index.html In the
I'm working with Jquery in Drupal. I have sets of four blocks that all
I have a jQuery dialog which loads an external php page. All is working
Here i have HTML: <form id=referalForm action=google.com> <label>Referring patient:</label> <input type=text ame=txtPname id=fullname placeholder=ENTER
All. I have been working on this for some time and can't seem to
so there I have this code in rails <%= f.label :year, Year: %><br />
i have some jquery code here that works fine in firefox but when 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.