let groceryList = document.querySelector('ul'); let newItem = document.createElement('li'); newItem.textContent = 'cheese'; groceryList.appendChild(newItem);
let toDoList = document.getElementById('toDo'); let newToDo = document.createElement('li'); newToDo.textContent = 'Write code'; toDoList.insertBefore(newToDo, toDoList.children[1]);
let rep = document.getElementById('replaceList'); let rep1 = document.createElement('li'); rep1.textContent = 'ooops'; rep.replaceChild(rep1, rep.children[6]);
let example = document.getElementById('removingNode'); example.removeChild(example.children[3]); example.children[0].remove();