Script Tag in JavaScript
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Title 24</title>
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body>
Hello World
<!-- Advantages of using separate script file using src attribute of script tag
1. Separation of concerns
2. Browser Caching -->
<script src="script.js">
console.log("I am trying to be smart"); //This will be ignored
</script>
</body>
</html>
script.js File

Comments
Post a Comment