Internal JavaScript

We can write your script code directly into your HTML document. Usually, we keep script code in the header of the document using <script> tag, otherwise, there is no restriction and you can put your source code anywhere in the document but inside <script> tag.

Example

<!DOCTYPE html>
<html>
   <head>
      <title>This page title</title>
<script src = "https://www.lecturely.com/wp-content/themes/divi-child/asset/external.js" type = "text/javascript"/></script>
   </head>
   <body>
      <input type = "button" onclick = "Hello();" name = "ok" value = "Click Me" />
		<script type = "text/javascript"/>
		function Hello() {
   	  alert("Hello, Javascript World");
		}
		</script>
   </body>
</html>