Created
June 24, 2021 07:41
-
-
Save blogjunkie/1a0acad7debddf926d6262c9eb4bc986 to your computer and use it in GitHub Desktop.
Move an element into a different div
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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