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()
Since you've included jquery tag... You can use prepend() method.
jquery
prepend()
Or you could use pure JS insertBefore:
insertBefore
item.insertBefore(newDiv, item.firstChild);