DEV Community

tanjiagang
tanjiagang

Posted on

How to insert elments using Javascript

Element.append() or Element.apeendChild(). append is different from appendChild: it can pass not onlyNode object but also strings.
we can use innerHTML attribute to insert strings containing elements into current Node object: Element.innertHTML = '<div></div>'

Top comments (0)