JavaScript in HTML must be inserted between <script> and </script> tags.
JavaScript can be put in the <body> and in the <head> section of an HTML page.
Example of JavaScript in the <body> :
<html>
<body>
<script>
document.write("<h1>Mindphp.com</h1>");
document.write("<p>Tutorials</p>");
</script>
</body>
</html>
This is the result:
Next