What is the function of the 'defer' attribute in a script tag? MCQ with Answer and Explanation

What is the function of the 'defer' attribute in a script tag?
A. To delay script execution until the page has parsed
B. To prevent script from running
C. To load the script after page load
D. To execute the script asynchronously
Answer: Option A
Solution (By JKSSB Mock Tests)
The defer attribute tells the browser to continue parsing the HTML while the script downloads, and execute it after the document is parsed, in order.

Discuss this Question (0)

No comments yet. Be the first to start the discussion!

Practice More Internet and Web Technologies Questions

Question #1
What is the purpose of the 'Accept' HTTP header?
A. To indicate the preferred language
B. To specify the media types the client can process
C. To list acceptable encodings
D. To specify the content type of the request body

Correct Answer: Option B


Explanation:
The Accept header informs the server about the media types the client can understand, e.g., text/html, application/json.

This question belongs to: Computer Internet and Web Technologies
Question #2
Which of the following tools acts as a specific component of a search engine that calculates page relevance rankings based on links and keywords when returning query listings?
A. The Crawler Daemon
B. The Cookie Tracking Core
C. The Cache Database
D. The Search Algorithm

Correct Answer: Option D


Explanation:
Search engine algorithms (like Google's PageRank) analyze index databases to evaluate and rank matching pages so users see the most relevant results first.

This question belongs to: Computer Internet and Web Technologies
Question #3
What is the purpose of the 'Cache-Control' HTTP header?
A. To authenticate the user
B. To set the language of the content
C. To specify caching policies for the resource
D. To control the format of the response

Correct Answer: Option C


Explanation:
The Cache-Control header is used to define caching directives such as max-age, no-cache, and private, controlling how and for how long the resource can be cached.

This question belongs to: Computer Internet and Web Technologies