What is the primary function of the ‘defer’ attribute when added to a script tag?

Web Development Medium

Web Development — Medium

What is the primary function of the ‘defer’ attribute when added to a script tag?

Key points

  • Defer prevents render-blocking behavior
  • Scripts with defer execute in document order
  • Async scripts execute as soon as they download

Ready to go further?

Related questions