This is so JavaScript can use this information to gain access to them . Ok, now we want JavaScript to alert us the value inside this box. Try altering the text in the text box, and try clicking above again. You will see that it will alert the new entry each time. Ok, so whenever you create a form, always remember to give both the form and the element a distinct name in which JavaScript can then acquire to access the element.
Lets do an illustration with multiple boxes.
Basic Calculator-Enter a math expression in the first box, and than use the calculate button to get the answer. It attempts to, and out pops JavaScript errors-we shall discuss validating forms in the next page. Finally, lets do a more complex example that has a little more practicality to it. Web Heaven . . . As you can see, we used the event handers we had learned before to give the textarea box different text, depending on the state of the mouse.