There are 3 ways to add JavaScript to a web page.
Embedding JS code between <script> and </script> tags.
Creating an external JS file via the src attribute of the <script> tag and loading it within the page.
Inserting code directly inside HTML tags using special tag attributes such as onclick, onmouseover, onload, etc.
Comments