…ript to assure you’re not breaking a selector. You see, there’s no actual separation going on here. Sure, the JS and HTML are in separate files, but these two technologies are fundamentally joined at the hip. They must move in lockstep or the application will crash.
HTML is a vestigial remnant of a much earlier web. When you only have markup and links, a simple hierarchical tree like HTML makes sense, but the moment that you add interactivity, HTML is not the right choice. As soon as you build a web interface that dynamically changes based on a data model and user input, you are forcing HTML to behave in a way that it wasn't designed to.