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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T03:37:01+00:00 2026-05-16T03:37:01+00:00

How to excange location to childrens of same parent? I solve using this pattern

  • 0

How to excange location to childrens of same parent?
I solve using this pattern of code.
Is there an easier way? For example something like this: $("#id1").exchange($("#id2"));

<!DOCTYPE html>
    <html>
    <head>
      <style>
      button { display:block; margin:3px; color:red; width:200px; }
      </style>
      <script src="http://code.jquery.com/jquery-latest.min.js"></script>
    </head>
    <body>
    <h1>Exchange places</h1>
    <ul>
     <li id="a">a</li>
     <li id="b">b</li>
     <li id="c">c</li>
     <li id="d">d</li>
    </ul>
    <button>exchange 1st,2nd</button>
    <button>exchange 1st,4th</button>
    <button>exchange 2nd,3rd</button>
    <script>

        $("button:first").click(function () {
          var cp = $("li:eq(0)").clone();
          $("li:eq(0)").replaceWith($("li:eq(1)").clone());
          $("li:eq(1)").replaceWith(cp);
        });

        $("button:eq(1)").click(function () {
          var cp = $("li:eq(0)").clone();
          $("li:eq(0)").replaceWith($("li:eq(3)").clone());
          $("li:eq(3)").replaceWith(cp);
        });

        $("button:last").click(function () {
          var cp = $("li:eq(1)").clone();
          $("li:eq(1)").replaceWith($("li:eq(2)").clone());
          $("li:eq(2)").replaceWith(cp);
        });
    </script>

    </body>
    </html>
  • 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-16T03:37:02+00:00Added an answer on May 16, 2026 at 3:37 am

    Take a look at SO question 698301. This answer doesn’t require cloning or even jQuery; just native DOM manipulation.

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

Sidebar

Related Questions

Is there a way to exchange ERD diagram from one tool to other as
Question: Is there a way to detect what XHtml conformance setting a particular ASP.Net
Okay, I'm asking the same thing as this deleted question , but I'm asking
Here is my code: using System; using System.Net; using MailListClient.MailListServiceReference; using Microsoft.Exchange.WebServices.Autodiscover; using Microsoft.Exchange.WebServices.Data;
I'm using Exchange Web Services to Find, Create, Update, and Delete appointments from the
Is there a method of accessing an Exchange server that does not have IMAP
Is there an equivalent for Interlocked.Exchange for boolean? Such as an atomic exchange of
Is there a CIL instruction to exchange the first two elements in the stack?
I am using Microsoft.Office.Interop.Outlook in C# to access a mailbox and find messages with
I'm currently troubleshooting an Intranet application hosted at our company. In this application, Windows

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.