DEV Community

Cover image for what is defer attribute for script tag in html ?
iliya khoshnodi
iliya khoshnodi

Posted on

what is defer attribute for script tag in html ?

Hi
hi in persian is salam👋

main picture

what is defer attribute for script tag in html ?

This Boolean attribute is set to indicate to a browser that the script is meant to be executed after the document has been parsed, but before running DOMContentLoaded.

it works only with external scripts.
It declares that the script will not create any content. So, the browser can continue the parsing of the rest of the page. The with the defer attribute does not block the page.</p>

Top comments (0)