FrontendDeveloper.in

HTML question detail

What is the difference between `defer` and `async` on scripts?

  • defer: downloads in parallel, executes after HTML parsing, keeps script order.
  • async: downloads in parallel, executes as soon as ready, order is not guaranteed.

For most app scripts that depend on order, defer is safer.

Back to all HTML questions
Get LinkedIn Premium at Rs 399