I'm currently using the following JavaScript code to insert AJAX responses into a div with an ID of results
:
document.getElementById("results").innerHTML=xmlhttp.responseText;
The issue I am encountering is that this code adds all new elements after those already present in the div. Ideally, I would like for the new elements to be inserted before everything else.
Although I acknowledge that this may seem like a simple task, I have been unable to figure out how to achieve this on my own.
Any assistance you can provide would be greatly appreciated! Thank you!