Create a file and save with .js extension.
Write javascript code in this file.
Do not write <script> tag and other html tag in .js file.
Syntax
fileName.js
Syntax
<script src="path or url " > </script>
example:
<script src="message.js" > </script>
It helps in the reusability of code in more than one HTML file.
It allows easy code readability.
It is time-efficient as web browsers cache the external js files, which further reduces the page loading time.
The .js file reduces the code complexity.
Code stealer can download your code using the url of the .js file.
Comsysapp.com is an educational website. Students and software developers can learn programming language tutorials. Comsysapp is very useful for beginners and professional developers. Comsysapp provides tutorial in easy language. Comsysapp.com has focus on simplicity.
Comsysapp.com provides free tutorials like c, html, css, etc. All tutorials are free for beginner and professionals.
comsysapp.com is not responsible for any mistake. We are not responsible if information made available on our website is incomplete or invalid. But comsysapp.com always try for zero-zero mistake.
comsysapp.com does not collect any data from users. We use Google AdSense advertising on our website. We never ask personal or private information.
copyright © 2023