Forms and event handlers

In this example, we have created a screen form named form1 which contains two objects, a textbox named toShow and a button. (Note that JavaScript is case sensitive).

The value property of the button determines what it says on its face, and the value property of the textbox is determined by whatever the user enters.

We have also written an event handler that is executed when the user clicks on the button. It is only one instruction long, and it creates an alert box showing the current value of the textbox.

 

What should the alert box say?


Disclaimer: The views and opinions expressed on unofficial pages of California State University, Dominguez Hills faculty, staff or students are strictly those of the page authors. The content of these pages has not been reviewed or approved by California State University, Dominguez Hills.