html insert js code example
Example 1: how to link javascript to html
<script src = "index.js"></script>
Example 2: how to add javascript in html
<script src="script.js"></script>
Example 3: insert js in html
<script src=¨script.js¨></script>
Example 4: where is the correct place to insert a javascript
You can place any script in the <body>, or in the <head> section.