Having used jQuery in the past, I think it would be fine for my use case. However, I don't want to end up with a mess on the front-end.
How do I write jQuery that doesn't end up that way? Is there a canonical text or set of best practices I can follow?
You also don’t need a framework yet. Just write code encapsulated by functions until it becomes a pain to maintain, and then look at frameworks.