Aug 5, 2024
.js
file and link it to HTML.index.html
file with the following structure:
<!DOCTYPE html>
<html>
<head>
<title>Biyush</title>
</head>
<body>
<h1>Welcome to Complete JS Course</h1>
</body>
</html>
<script>
tag to add JavaScript code within the HTML file:
<script>
console.log("Hello World");
</script>
console.log("My name is Piyush");
console.log(1);
console.log(1 + 1);
script.js
in the 01 folder.<script src="script.js"></script>
script.js
:
console.log("Hello from external.js file");
<script src="script.js"></script>
<script>
console.log("Hey again from internal script");
</script>
<script src="hello.js"></script>