0Pricing
HTML Academy · Lesson

The async and defer Attributes

Load scripts without blocking HTML parsing.

Default Script Behavior

A plain <script src="..."> without async or defer blocks HTML parsing while it downloads and executes. The render of everything below the script is paused, which is why scripts traditionally lived at the bottom of <body>.

async Downloads in Parallel

<script async src="..."> downloads the script in parallel with HTML parsing and executes it as soon as it arrives. Execution still pauses HTML parsing, but only briefly — the script does not block the download of other resources.

All lessons in this course

  1. The async and defer Attributes
  2. Preload Prefetch and Preconnect
  3. Lazy Loading Images loading=lazy
  4. Resource Hints modulepreload
← Back to HTML Academy