1

async is a good way to eliminate render-blocking resources, so I am trying to implement that in one of my projects. However, I see people declaring that in different ways:

<script src="demo_async.js" async></script>

and

<script src="demo_async.js" async="async"></script>

Does it matter which way it is being declared? Especially in terms of browser compatibility...

2
  • @herecticMonkey No It does not. But Thanks! Commented Feb 13, 2020 at 18:16
  • 2
    The accepted answer to that question states "setting async=true, async=false or async=anything all mean the same thing.", which is exactly what the accepted answer to this question states. Don't see how that doesn't answer your question. Commented Feb 13, 2020 at 18:18

1 Answer 1

5

No, it's a boolean attribute so it doesn't matter if you give it a value or not.

From MDN:

This is a boolean attribute: the presence of a boolean attribute on an element represents the true value, and the absence of the attribute represents the false value.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.