I'm creating a fight log where combat information will go inside a div box that holds about 15 lines. After 16+ lines, the text goes through the box and starts heading south.
Is there a way in Javascript to say "hey, after 15 lines, create a new line, and delete the last line!".
I'm thinking I would set this up with arrays. Would that be correct? Where I would say something along the lines of.. 15 elements, and after 16 elements, delete last element and push a new element?
This is all I have for code:
document.getElementById("log").innerHTML += "Fight Log";
After 15+ of these, it goes outside the DIV Fight Log box.