In this example, the JavaScript is used to check the contents of a form before shipping it to the server.

Enter your first name
Enter your last name
Enter a phone number in this format (555) 555-1234