Despite the similarity in names, JavaScript and Java are different technologies, and you should not confuse one with the other. Unlike JavaScript, Java programs do need to be compiled. One other difference to keep in mind is that the development of JavaScript was pioneered by Netscape, whilst Java was developed by Sun Microsystems. Each object can possess a series of properties . For example, you could define an object in your program called person , with properties such as age , height , name , etc.
Objects have the ability to do things.
Similarly, you can write functions in JavaScript, which are routines that change the properties of objects. For example, the onLoad event occurs when a document is loaded into the browser. The best way of learning JavaScript is to experiment with adding a few simple features to your own Web pages. The code has been hidden between comment tags. Having defined your JavaScript function, you can then trigger it from various points within the body of your document.