Unlike HTML, which is a Mark-up language, JavaScript is a comprehensive programming language that allows increased functionality to be added to web pages.
JavaScript and Java are not related languages although there are some similarities in syntax.
JavaScript allows decision branches to alternative instructions depending on set conditions.
There are server-side and client-side versions of JavaScript but it's the client-side version that is most common and covered here.
Client-side JavaScript is embedded in HTML pages that download to the browser and the JavaScript is then parsed by the browser alongside HTML.
JavaScript has object-oriented capabilities which make it useful for interacting with the DOM, which is a kind of map that holds information about all the objects on a web page.
Knowledge of the DOM and JavaScript, as well as HTML, are required for DHTML and Ajax.
JavaScript can control the behaviour of the browser, open new browser windows and write text or HTML instructions into a document.
It can interact with HTML forms as well with the user by capturing events, such as mouse events, and triggering event handlers.
What JavaScript Won't Do
JavaScript has no built in graphics capabilities but it can write HTML tags into a page, including image tags.
For security reasons JavaScript can't read or write files on a user's machine nor can it generate emails.