JavaScript Is Object-Based

JavaScript is an object-based language. The term object-based should not make you nervous: For us, object-based programming will be a lot easier. For our purposes, object-based programming just means that JavaScript makes available objects that give us access to some aspect of the browser or document.

For example, we already have used the document object, one of the most powerful JavaScript objects, in this chapter. That object refers to the body of the Web page in the browser. With this object, you have access to the HTML in the page. In the previous example, I used the writeln (which stands for “write line”) method of the document object to write "Welcome to JavaScript!", like this:

 <SCRIPT LANGUAGE="JavaScript"> ...

Get Real World XML now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.