Last active
July 30, 2020 16:46
-
-
Save rexar1988/5a8fc1e55f4ba656959413c46bedd015 to your computer and use it in GitHub Desktop.
Create and append element in Vanilla JavaScript
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
// Элемент который нужно вставить | |
const element = document.querySelector('.element'); | |
// Элемент-контейнер после которого мы вставим контент | |
const parentElement = document.querySelector('.parent-element'); | |
// Вставка | |
parentElement.after(element) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment