js add children to dom code example
Example 1: appendchild javascript
const parent = document.createElement('div');
const child = document.createElement('p');
const childTwo = document.createElement('p');
parent.append(child, childTwo, 'Hello world');
parent.appendChild(child, childTwo, 'Hello world');
Example 2: appendchild javascript
const parent = document.createElement('div');
const child = document.createElement('p');
const appendValue = parent.append(child);
console.log(appendValue)
const appendChildValue = parent.appendChild(child);
console.log(appendChildValue)