Q. The external JavaScript file must contain the <script> tag?.
β
Correct Answer: (B)
False
Explanation:
The answer is (B) False.
Explanation:
- In an external JavaScript file (like script.js), you should not include the <script> tag inside the file.
- The external file should contain only JavaScript code.
- You include it in an HTML page using:
<script src="script.js"></script>
But inside script.js, you do not write <script> ... </script>. Only pure JavaScript code like:
console.log("Hello from external JS!");