Definition 1. JavaScript is designed to add interactions to HTML pages. 2. JavaScript is a scripting language (scripting language is a lightweight programming language ). 3. JavaScript consists of several lines of executable computer code. 4. JavaScript is usually directly embedded into HTML pages. 5. JavaScript is an explanatory language (that is, code execution is not precompiled ). 6. All users can use JavaScript without buying a license. Role 1. JavaScript provides HTML designers with a programming tool and a scripting language with extremely simple syntax! 2. javaScript can add dynamic text to HTML page 3. javaScript can respond to an event and set it to be executed only when an event occurs. 4. javaScript can read and write HTML elements. 5. javaScript can be used to verify data before data is submitted to the server. 6. javaScript can be used to detect the visitor's browser and load the corresponding page for the browser based on the detected browser. 7. JavaScript can be used to create cookies, store and retrieve information on the visitor's computer. Add javascript in HTML Method 1: Add [html]