- JavaScript can also be placed in external files. External JavaScript files often contain code to be used on several different web pages. External JavaScript files have the file extension .js.
- You can use attribute src to include an external file containing JavaScript code:<script language="JavaScript" src="hello.js"></script>
- For example, shown below is the code of the external file hello.js
document.write("Hello World!")
src variable - using an external JavaScript
Subscribe to:
Post Comments
(
Atom
)
0 comments :
Post a Comment