Answer & Solution
<script>
tag is used to specify the scripting language used in the script, such as JavaScript. It helps browsers identify and interpret the script correctly.
<script>
tag?
<script>
tag is used to specify the scripting language used in the script, such as JavaScript. It helps browsers identify and interpret the script correctly.
What attribute of the <script>
tag allows asynchronous loading of scripts?
A). type='async'
B). async='true'
C). defer='async'
D). async
When including multiple <script>
tags in an HTML document, what determines the order of script execution?
A). The order in which the <script>
tags appear in the HTML document.
B). The order specified by the async attribute in each <script>
tag.
C). The alphabetical order of the script filenames.
D). The defer attribute in each <script>
tag.
Which attribute is used to specify the location of an external JavaScript file in the <script>
tag?
A). href
B). url
C). src
D). location
What is the purpose of using the async attribute in the <script>
tag?
A). To ensure the script is executed after the document is parsed.
B). To execute the script synchronously.
C). To load the script asynchronously, improving page load performance.
D). To delay script execution until user interaction.
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.
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.
Which attribute can be used to include a JavaScript file asynchronously?
A). async='true'
B). defer='async'
C). type='async'
D). async
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.
Where is the recommended place to include external JavaScript files in an HTML document?
A). Inside the <head>
section.
B). Before the closing
tag.
C). After the opening
D). Inside the <body>
section, anywhere.
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