1 //method one
2 var c = document.getElementById("myDIV").childNodes;
3 c[1].style.backgroundColor = "yellow";//first child
4 c[2].style.backgroundColor = "red";//second child
5 c[-1].style.backgroundColor = "green";//last child
6 c[-2].style.backgroundColor = "blue";//secound last child
7//method two
8 let nth-child = document.querySeletorAll('myDiv:nth-child(n)');//gives nth child