You don’t need any special software to write JavaScript. All you need is a plain text editor and a web
browser.
Code written in JavaScript must be executed from a document written in (X)HTML. There are three
ways of doing this. You can place the JavaScript between tags within the of the
document:
Example
JavaScript goes here...
Mark-up goes here...
A much better technique, however, is to place your JavaScript code into a separate file. Save this file
with the file extension .js. Traditionally you would include this in the portion of the document by
using the src attribute in a tag to point to this file:
1