So I'm working on a personal project which is just a simple status update. I'm constantly adding more functionality to it but I've been stuck for quite some time now. The problem is that whenever someone posts a new status I want that to appear on top, however the one on top is the first post created, which is a problem. This would mean you'd have to scroll down to the bottom to see the most recent post.
Screenshots:
Problem occurs, new element goes underneath old
Here is the javascript:
function statusPost() {
status = document.getElementById("Status").value;
if (status == "") {
alert("Please write a status")
}
else {
document.getElementById("Status").value = "";
div = document.createElement("div");
document.getElementById("container").appendChild(div);
div.className = "update";
div.innerHTML = status;
}
}