Skip to content

Instantly share code, notes, and snippets.

@folmert
Created May 30, 2015 21:04
Show Gist options
  • Save folmert/73c66365d83fa9c270d4 to your computer and use it in GitHub Desktop.
Save folmert/73c66365d83fa9c270d4 to your computer and use it in GitHub Desktop.
HTMLDivElement.prototype.relocate = function ( where ) {
var t = this;
where.appendChild( t );
t.parentNode.removeChild( t );
}
var div1 = document.getElementById( '#urbanDiv' );
var div2 = document.getElementById( '#villageDiv' );
div1.relocate( div2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment