"Avoiding JavaScript if possible" is a huge mood. I cram already extant JavaScript into projects from time to time, but my experience with it is super limited, so actually troubleshooting it quickly becomes a nightmare.