Not necessarily a thing you should do if you want any kind of separability or version control. But definitely a thing you can do.
What blows my mind is that people use frameworks where they include stuff that's not even JS in their HTML, stuff that needs external JS to attach to it or hydrate it. That feels like the worst of both worlds.
I definitely come from an opposite place where JS is king and I don't have any files with an ".html" extension exept for "index.html". And I don't have any HTML in my JS, either. Anything that's a partial template is ".htm" and gets hydrated before it gets added to the DOM.
What blows my mind is that people use frameworks where they include stuff that's not even JS in their HTML, stuff that needs external JS to attach to it or hydrate it. That feels like the worst of both worlds.
I definitely come from an opposite place where JS is king and I don't have any files with an ".html" extension exept for "index.html". And I don't have any HTML in my JS, either. Anything that's a partial template is ".htm" and gets hydrated before it gets added to the DOM.