πŸ“Š JavaScript
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
πŸ’¬ Discuss
βœ… Correct Answer: (A) src

Explanation:

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.

Explanation by: Official MCQ Buddy

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.

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
259
Total Visits
πŸ“½οΈ
4 y ago
Published
πŸŽ–οΈ
Babita
Publisher
πŸ“ˆ
95%
Success Rate