Skip to content

Instantly share code, notes, and snippets.

@blogjunkie
Created June 24, 2021 07:41
Show Gist options
  • Save blogjunkie/1a0acad7debddf926d6262c9eb4bc986 to your computer and use it in GitHub Desktop.
Save blogjunkie/1a0acad7debddf926d6262c9eb4bc986 to your computer and use it in GitHub Desktop.
Move an element into a different div
// Move `.element` into `#inner-wrap`
// The code has to appear after the elements, otherwise it will throw an error
const moveMe = document.querySelector('#main .element');
const target = document.querySelector('#inner-wrap');
target.appendChild(relatedPosts);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment