<head>
tag. C). After the opening tag. D). Inside the <body> section, anywhere. Answer & Solution Answer: Option B Solution: The recommended place to include external JavaScript files is before the closing tag. This ensures that the JavaScript code is loaded after the HTML content, improving page loading performance. Related Questions on Average What is the purpose of using external JavaScript files instead of inline code? A). To reduce code redundancy and promote code reusability. B). To execute JavaScript code asynchronously. C). To ensure inline code executes before external code. D). To improve security by isolating JavaScript code. View Answer How does the browser handle the execution of a <script> tag with the defer attribute? A). It delays script execution until after the document is parsed, maintaining script order. B). It executes the script as soon as it's available, even if the document is still parsing. C). It waits for user interaction before executing the script. D). It prevents the script from executing until the user interacts with the page. View Answer What happens if the src attribute is used along with inline JavaScript code inside the <script> tag? A). The inline code is ignored, and only the external file specified in src is loaded. B). Both the inline code and the external file specified in src are loaded. C). The browser throws an error because the src attribute cannot be used with inline code. D). Only the inline code is executed, and the external file specified in src is ignored. View Answer What is the purpose of including the defer attribute in a <script> tag? A). To execute the script asynchronously. B). To delay script execution until after the document is parsed. C). To specify the scripting language used in the script. D). To load an external script file. View Answer What attribute of the <script> tag allows asynchronous loading of scripts? A). type='async' B). async='true' C). defer='async' D). async View Answer Which scenario is ideal for using the async attribute in the <script> tag? A). When the script must be executed in a specific order. B). When the script contains critical functionality that should not be delayed. C). When the script can be executed independently and does not depend on other scripts or document elements. D). When the script must be executed after the document is parsed. View Answer How can you include an external JavaScript file using the <script> tag? A). <script src='script.js'></script> B). <script>src='script.js' C). <script type='text/javascript' src='script.js'></script> D). <js src='script.js'></js> View Answer How can you specify the version of JavaScript used in a <script> tag? A). By including the version attribute in the <script> tag. B). By specifying the JavaScript version in the opening <script> tag comment. C). By using the type attribute with the appropriate MIME type. D). By placing the JavaScript code within a CDATA section. View Answer Which attribute of the <script> tag is used to delay script execution until after the document is parsed? A). type='defer' B). async='false' C). defer='true' D). defer View Answer What is the purpose of the language attribute in the <script> tag? A). It specifies the scripting language used in the script. B). It defines the content type of the script file. C). It indicates whether the script is inline or external. D). It specifies the version of HTML used in the document. View Answer Copyright © RVR Innovations LLP 2026 | All rights reserved - Mytat.co is the venture of RVR Innovations LLP
<body>
What is the purpose of using external JavaScript files instead of inline code?
A). To reduce code redundancy and promote code reusability.
B). To execute JavaScript code asynchronously.
C). To ensure inline code executes before external code.
D). To improve security by isolating JavaScript code.
How does the browser handle the execution of a <script> tag with the defer attribute?
<script>
A). It delays script execution until after the document is parsed, maintaining script order.
B). It executes the script as soon as it's available, even if the document is still parsing.
C). It waits for user interaction before executing the script.
D). It prevents the script from executing until the user interacts with the page.
What happens if the src attribute is used along with inline JavaScript code inside the <script> tag?
A). The inline code is ignored, and only the external file specified in src is loaded.
B). Both the inline code and the external file specified in src are loaded.
C). The browser throws an error because the src attribute cannot be used with inline code.
D). Only the inline code is executed, and the external file specified in src is ignored.
What is the purpose of including the defer attribute in a <script> tag?
A). To execute the script asynchronously.
B). To delay script execution until after the document is parsed.
C). To specify the scripting language used in the script.
D). To load an external script file.
What attribute of the <script> tag allows asynchronous loading of scripts?
A). type='async'
B). async='true'
C). defer='async'
D). async
Which scenario is ideal for using the async attribute in the <script> tag?
A). When the script must be executed in a specific order.
B). When the script contains critical functionality that should not be delayed.
C). When the script can be executed independently and does not depend on other scripts or document elements.
D). When the script must be executed after the document is parsed.
How can you include an external JavaScript file using the <script> tag?
A). <script src='script.js'></script>
<script src='script.js'>
</script>
B). <script>src='script.js'
C). <script type='text/javascript' src='script.js'></script>
<script type='text/javascript' src='script.js'>
D). <js src='script.js'></js>
<js src='script.js'>
</js>
How can you specify the version of JavaScript used in a <script> tag?
A). By including the version attribute in the <script> tag.
B). By specifying the JavaScript version in the opening <script> tag comment.
C). By using the type attribute with the appropriate MIME type.
D). By placing the JavaScript code within a CDATA section.
Which attribute of the <script> tag is used to delay script execution until after the document is parsed?
A). type='defer'
B). async='false'
C). defer='true'
D). defer
What is the purpose of the language attribute in the <script> tag?
A). It specifies the scripting language used in the script.
B). It defines the content type of the script file.
C). It indicates whether the script is inline or external.
D). It specifies the version of HTML used in the document.
Copyright © RVR Innovations LLP 2026 | All rights reserved - Mytat.co is the venture of RVR Innovations LLP