I have a div and i want to append another div inside it. but, by using appendChild() it always insert DOM element in end of container element.but i want to inse
appendChild()
I think you find insertBefore.
parentElem.insertBefore(insertedElem, parentElem.firstChild);