Why do we use JS?
JavaScript interaction with the site was mostly limited to interacting with forms, giving feedback to the user and detecting when they do certain things. We used “alert” to notify the user of something, “confirm” to ask if something is OK to do or not and either “prompt” or a form field to get user input.
3 ways to use it: