A

Admin • 828.03K Points
Coach

Q. The external JavaScript file must contain the <script> tag?.

  • (A) True
  • (B) False
  • (C) ---
  • (D) ---
  • Correct Answer - Option(B)
  • Views: 7
  • Filed under category JavaScript
  • Hashtags:

Explanation by: Admin

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!");

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.