Thanks to Tim Berners-Lee, the first version of HTML came to life in 1991. At that time it supported only text and consisted of just 18 tags. It seems too little for these days but that was a great first step in building websites almost thirty years ago.
To make websites more attractive and increase readability – Cascading Styles Sheets (CSS) was developed. Then the challenge appeared – most browsers weren’t compliant with CSS specifications. What was looking good in one browser was unappealing in the other. Even the most favored at that time Internet Explorer could poorly implement several CSS features. The problem with supporting multiple browsers had to be solved. The Web Standards Project and the online communities did a lot of work to fix these issues.
At the beginning of Web development history, the sites were static, having only basic styles without any dynamics. There were simple documents that contained links to one another.
This way JS became a minimal solution for creating dynamic pages. At that time a need in interaction on the client-side of the web page appeared. The part of the business-logic has moved to front-end that enabled creating web apps independently from the server part.