+ 2
What is the point of using JavaScript if you can just get the same outcome in HTML?
4 ответов
+ 3
JS adds interactivity and other features that HTML may not support.
It also makes HTML more lenient by supporting its code while leaving JS optional as an external script or in-line code.
While you can animate purely in JS and CSS, you won't have the brain function of the code.
+ 1
The point is that most of the time we don't get the same outcome in HTML without JS.
+ 1
We use JavaScript to add interactivity to our webpages. Without JavaScript, Buttons and other things that need interactivity wouldn't do anything.
0
If my assumption are right you are thinking why to use js specially dom to change text instead directly change from html.Right?
Yes we can do it that way but only when we are building small and static website for ourself but when we are building real website than it has to include js so that user can interact with our website.
Consider sololearn post example , post will be posted only when user clicks on post or send button.
Hope this helps☺️☺️.