As a beginner, learning html, css and javascript you must at a point ask yourself question like, cant i build a website without javascript or say whats is javascript doing that i cant ignore?
Yes, there is a place for each it, html to add content, CSS to style and Javascript for functionality or interactive and some call it behaviour.
For example, When your alarm wakes you 5am, you either off it or snooze it uisng the button, so think of all the content you see (html), then how the alarm is designed(CSS) i.e interface then when you press the button to left or right and something happened(Javascript).
But