A

Admin • 831.35K Points
Coach

Q. Which of the following Attribute is used to include External JS code inside your HTML Document

  • (A) src
  • (B) ext
  • (C) script
  • (D) link
  • Correct Answer - Option(A)
  • Views: 18
  • Filed under category JavaScript
  • Hashtags:

Explanation by: Admin

The src attribute is used to include an external JavaScript file inside an HTML document. It specifies the path to the external .js file.

Example:

<script src="script.js"></script>

Other options:

  • (B) ext → Incorrect, as there is no ext attribute for including JavaScript.
  • (C) script → Incorrect, because <script> is an HTML tag, not an attribute.
  • (D) link → Incorrect, as <link> is used for CSS files, not JavaScript.

Thus, the correct answer is (A) src.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.