html tutorial - async Attribute in HTML - html5 - html code - html form

Autocomplete attribute in html

Learn html - html tutorial - Autocomplete attribute in html - html examples - html programs

  • The async attribute is said to be a Boolean attribute.
  • The async attribute is used to execute the script asynchronously depends upon its availability.
  • The async attribute only presents with combination of src attribute. Because external script only use async attribute.

Syntax for async attribute in HTML:

<script src="source name" async></script>

Applies To:

Elements Attribute
<script> async

Sample Coding for async Attribute in HTML:

Tryit<!DOCTYPE html>
        <title>Wikitechy async attribute</title>
        <script src="async_demo.js" async></script>
        <h2>Welcome to Wikitechy!</h2>

Code Explanation for async Attribute in HTML:

async Attribute Code Explanation

  1. src attribute is used to specify the external JavaScript file location as “async_demo.js”.
  2. async attribute is used to set the file parsing “async_demo.js” as asynchronously.

Output for async Attribute in HTML:

async Attribute Output

  1. The output shows the <h2> element (“Welcome to Wikitechy!”) and the alert message (“Hello wikitechy!”). Because the async attribute is set so the contents are loading asynchronously.
  2. async Attribute Output
  3. If the async attribute not set the content loading synchronously so the content of <h2> is not loaded.

Browser Support for async Attribute in HTML:

Yes 10.0 3.6 Yes Yes

Related Searches to async Attribute in html

Adblocker detected! Please consider reading this notice.

We've detected that you are using AdBlock Plus or some other adblocking software which is preventing the page from fully loading.

We don't have any banner, Flash, animation, obnoxious sound, or popup ad. We do not implement these annoying types of ads!

We need money to operate the site, and almost all of it comes from our online advertising.

Please add to your ad blocking whitelist or disable your adblocking software.