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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T17:48:12+00:00 2026-06-09T17:48:12+00:00

so I followed an HTML5 drag and drop example here: http://www.html5rocks.com/en/tutorials/dnd/basics/#toc-dataTransfer and created the

  • 0

so I followed an HTML5 drag and drop example here:

http://www.html5rocks.com/en/tutorials/dnd/basics/#toc-dataTransfer

and created the following code

http://jsfiddle.net/Vk5zT/

The problem is, I want to be able to essentially swap the entire element, and its data attributes, not just the inner html. How do I do this?

  • 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-09T17:48:13+00:00Added an answer on June 9, 2026 at 5:48 pm

    You could just swap the elements themselves, not serializing and reparsing new elements.

            var parent = this.parentNode,
                insertionPoint, elem = this;
    
            do {
                elem = elem.nextSibling;
            } while (elem && elem !== draggedItem);
    
            insertionPoint = elem ? this : this.nextSibling;
            parent.insertBefore(draggedItem, insertionPoint);
            draggedItem = null;
    

    http://jsfiddle.net/Vk5zT/11/

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

Sidebar

Related Questions

I have followed a couple of tutorials (http://www.adobe.com/devnet/html5/articles/javascript-motion-detection.html, http://www.html5rocks.com/en/tutorials/canvas/notearsgame/ ) and spliced the two
I followed http://www.beakkon.com/tutorial/html5/desktop-notification tutorial for html 5 desktop notifications. The demo on that page
I followed the HTML5 Websocket tutorial of the website below: http://net.tutsplus.com/tutorials/javascript-ajax/start-using-html5-websockets-today/ It worked well,
I followed this tutorial http://www.vogella.com/articles/AndroidCloudToDeviceMessaging/article.html I wrote the manifest File giving all the permissions
I followed this tutorial and got the basics of Content Providers : http://www.vogella.de/articles/AndroidSQLite/article.html But
I have a Silverlight project that uses MVVM with Prism. I followed http://www.telerik.com/help/silverlight/patterns-and-practices-eventtocommand-prism.html I
I followed this great tutorial toajax my blog: http://www.deluxeblogtips.com/2010/05/how-to-ajaxify-wordpress-theme.html But it creates some problems
i had followed exactly same procedure on google's tutorial: http://developer.android.com/guide/tutorials/views/hello-mapview.html ...while i got force
I have followed this tutorial: http://www.phpjabbers.com/how-to-make-a-php-calendar-php26-6.html#comments to make a very basic calendar. My aim
I followed the example: http://arunranga.com/examples/access-control/credentialedRequest.html from this page: http://arunranga.com/examples/access-control/ The example work in Firefox,

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.