Changes

Jump to: navigation, search

A Simple JavaScript Example

208 bytes added, 18:48, 9 April 2007
no edit summary
Previously we discussed the event driven nature of JavaScript. In the next example we will extend the "Hello World" example to include event handling, in this case designing our script to display an alert dialog when a button is pressed.
Edit the previous HTNL HTML file and modify the script code so that is resembles the following:
<pre>
</html>
</pre>
 
When loaded into a web browser the page will appear as before, but this time a push button is visible in the page which, when pressed, will display an alert dialog containing the words "Goodby cruel world".

Navigation menu