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.


<!DOCTYPE html>
      <title>This page title</title>
<script src = "" type = "text/javascript"/></script>
      <input type = "button" onclick = "Hello();" name = "ok" value = "Click Me" />
		<script type = "text/javascript"/>
		function Hello() {
   	  alert("Hello, Javascript World");