In the <head>. This starts the download early (in parallel with HTML parsing) while deferring execution until after parsing. This is faster than placing scripts at the bottom of <body>.
Where should you place defer script tags in HTML?
More FAQs in How async and defer Impact Page Rendering
It blocks HTML parsing and rendering. The browser stops parsing, downloads the script, executes it, then resumes. This makes the page feel slow, especially for large scripts.
Only briefly. async downloads in parallel (no blocking). But when the script is ready, it pauses parsing to execute. The pause is brief but can cause a janky render.
No. defer downloads in parallel and executes only after all HTML is parsed. The page renders fully before deferred scripts run. This is the most non-blocking option.
Still have questions?
Browse all our FAQs or reach out to our support team
Want to upskill yourself?
Your learning library
Small steps. Big possibilities.
Find your next course. Build something great.