Not sure I can compete with the some of the excellent detail already provided, but I think, for me, it boils down to compiled languages versus interpreted/scripted ones.
Websites, needing to be platform agnostic (and the evolving list of browsers ever growing), were always going to favour the latter to stand any chance of adoption.
Javascript briefly contested this title with VBScript, but has long been king on the client-side, hence it's increasingly broad adoption. Server side scripting is, of course, a slightly different battle, but results in pure HTML (and JS) arriving at the client browser.
Interestingly, new kids on the block like Typescript, a lot closer to traditional high level (compiled) languages, still rely heavily upon ECMAScript standards to produce bundled i.e. compiled JS.