In here we see how many ways we can include javascript code. Basically there are 3 ways to include Javascript in HTML.
Direct code within the <script> ... </script> tag
Example:-
Include a external javascript file <script src='myscript.js'></script>
Example:-
Add a code in between HTML tag <input type="button" value="Click here" onClick="alert('Hello')">
Example:-