I think that is fine. You can try eliminate some code repetition on your JS and maybe split it and various functions, so it can be more readable and reusable. But don’t worry, it work just fine, it’s just something you can improve and learn a trick or another while you play at.