Answer & Solution
<container><script src='app.js?v=1.0'></container>.
<container><script src='app.js?v=1.0'></container>.
What is the advantage of using external JavaScript files?
A). Improves code readability
B). Allows reuse of code
C). Improves page load times due to caching
D). All of the above
How can you include multiple external JavaScript files in a web page?
A). Use multiple <container><script></container> tags
B). Separate file names with commas
C). Separate file names with semicolons
D). Use a single <container><script></container> tag with multiple src attributes
Which HTML tag is used to link an external JavaScript file?
A). <container><script></container>
B). <container><link></container>
C). <container><style></container>
D). <container><js></container>
How do you include an external JavaScript file in an HTML file?
A). <container><script src='filename.js'></container>
B). <container><script href='filename.js'></container>
C). <container><script link='filename.js'></container>
D). <container><script file='filename.js'></container>
How do you comment out code in JavaScript?
A). // This is a comment
B). /* This is a comment */
C). <!-- This is a comment --!>
D). ## This is a comment
Can an external JavaScript file contain HTML?
A). Yes
B). No
C). Only if it is within a <container><script></container> tag
D). Only if it is within a <container><body></container> tag
What is the purpose of using external JavaScript files?
A). To keep HTML and JavaScript code separate
B). To reuse the JavaScript code on multiple pages
C). To improve the maintainability of the code
D). All of the above
Can an external JavaScript file be cached by the browser?
A). Yes
B). No
C). Only if specified in the HTML
D). Only if it is under a certain size
How do you execute JavaScript code after the HTML document has loaded?
A). Use the defer attribute in the <container><script></container> tag
B). Place the <container><script></container> tag at the end of the <container><body></container> section
C). Use the async attribute in the <container><script></container> tag
D). All of the above
Which file extension is used for JavaScript files?
A). .java
B). .js
C). .javascript
D). .jsx