The JavaScript code is placed between the <script> and </script> tags.
<script>
document.getElementById("demo").innerHTML = "Introduction to JavaScript";
</script>
A JavaScript function is a chunk of JavaScript code that runs when you call it.
You can position the JavaScript functions in the <head> and <body> of the HTML documents. JavaScript can also be placed in external files with extension with .js.