2

I need to know if a tag is async by parsing html. I got a problem that I can't find any document about the valid value (and meaning) of async attribute.

What I know is that for async the valid value is:

  • async
  • async="async"

for non-async:

  • async="false"

what does async="" mean? and any other value?

0

1 Answer 1

3

According to the specification it is:

async = "async" or "" (empty string) or empty

(where empty means async, without assigning a value)

Its meaning:

Specifies that the script should be executed asynchronously, as soon as it becomes available.

So the browser should attempt to download the script file, without waiting to continue parsing the page. It loads the script as soon as it is done downloading.

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

3 Comments

so async="false" is actually not a valid value?
What does the specification say? Only the values given there are valid.
The given link is no longer valid. The attribute is described as a boolean attribute here: w3.org/TR/2011/WD-html5-20110525/… And boolean attributes are described here: w3.org/TR/2011/WD-html5-20110525/…

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.