event.target.appendchild code example
Example 1: appendchild javascript
const parent = document.createElement('div');
const child = document.createElement('p');
parent.append(child)
parent.appendChild(child)
parent.append('Hello world')
parent.appendChild('Hello world')
Example 2: add a child html object to another html object in js
parent.append(child);
parent.insertBefore(child, list.childNodes[0]);
Example 3: appendchild on specific position
parentElement.insertBefore(newElement, parentElement.children[2]);