Q. Which of the following Attribute is used to include External JS code inside your HTML Document
β
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.