External and Internal JavaScript
-
Internal JavaScript
It means we use JavaScript within the same file
Ex.
<head>
<title>JavaScript</title>
<script type="text/javascript">
alert("Hi, this is codersarts");
</script>
</head>
-
External JavaScript: This means use javascript with an external js file.
Use src to include the external js file:
<script type="text/javascript" src="javascript.js">