JavaScript allows you to make web pages more interactive by accessing and modifying the content and markup used in a web page while it is being viewed in the browser.
1- ACCESS CONTENT: You can use JavaScript to select any element, attribute, or text from an HTML page.
2- MODIFY CONTENT: You can use JavaScript to add elements, attributes, and text to the page, or remove them.
3- PROGRAM RULES You can specify a set of steps for the browser to follow (like a recipe), which allows it to access or change the content of a page.
4- REACT TO EVENTS You can specify that a script should run when a specific event has occurred.