This page demonstrates a few features of JavaScript.

In the first example we get the input from a form and display it.

What's your favorite food?

This example shows how to generate an alert when a button gets clicked!

I have a couple of Web pages that go along with JavaScript tutorials I've presented: I've written some about using JavaScript in Appendix E of Learning to Use the World Wide Web.
There are lots of places on the Web that have much better collections of examples. Some places to look are I really like this book!
Designing With JavaScript : Creating Dynamic Web Pages by Nick Heinle 
O'Reilly & Associates; ISBN: 1565923006.

Some other places you may want to visit
Internet Today! Learning to Use the Internet Learning to Use the World Wide Web Searching and Researching on the World Wide Web