Netscape developed a language to add more control to pages and called it LiveWire. They got together with Sun who was developing Java at the time. They decided to call the new language JavaScript even though it and Java are very different. In response, Microsoft introduced a version of Visual Basic called VBScript. They also made a slightly different version of JavaScript and called in JScript. The standard version of the language is called ECMAScript.
Whatever the name, the new language added dynamic control over elements on the page. This is a very important part of web page design. HTML describes the structure and overall layout of the page. CSS controls the appearance and detailed layout. JavaScript provided form validation, mouse controls and interactivity. Java provides database access and complete interactivity.
JavaScript code goes in between special tags in HTML.
There are a lot of common events in the browser. These are just things that happen, like mouse moves, mouse clicks, a page is loaded or unloaded, values in form fields change. They are given names like onClick or onChange. You can tell the browser that whenever a certain event occurs, you want some JavaScript to be run. You do this by using attributes on HTML tags. Here is an example where I want to do something when a button is pressed.
The onChange event is part of a form element like a text box or area. Whenever a user enters something and then clicks outside the box, tabs to the next field or hits return, this event is triggered.Objects are nested like boxes in the display. So, any form you might have would be inside the document. And form elements are inside the form. Forms are easy to use in JavaScript since you can refer to a form object just be using its name. So if the form is named "addressform" and the text box is named "fname", you can refer to is like this.