- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to set the script to be executed asynchronously in HTML?
Use the async attribute to set the script to execute asynchronously as and when it is available. It only uses the external script.
Firstly, add a js file. Let us give it a name, new.js,
function sayHello() { alert("Hello World") }
Let’s add the HTML code now and execute the above script −
<html> <head> <script src = "new.js" ></script> </head> <body> <p>This is demo text.</p> </body> </html>
Advertisements