How to create an external script file?
Are you preparing for IT certification? With practice questions, study notes, interactive quizzes, tips and technical articles, uCertify PrepKits ensure that you get a solid grasp of core technical concepts to ace your certification exam in first attempt.
How to create an external script file?
Rating:
An external script file is a file that is created outside the main HTML document. This file can be invoked in any HTML document with the help of the src attribute of the <script> tag. The code of an external script file can be written in any text editor and must be saved with the .js extension.
The following code will create an external script file:
{
//statements
}
When this file is saved as script1.js, the following code can be used to invoke the file in the HTML document:
Rating:
Was this information helpful?
Other articles
- What is the bold method?
- What is the while loop?
- What is the with statement?
- How to use the open method?
- What are comments?
