Front-end steps after each other (JS)