CSCI 4230
 Internet Application Development
 Fall 2001
 Homework #5

Due date: October 24, 2001 (Wednesday)

(1)    Write a HTML/Javascript program, h5q1.html, to accept user input text and count the words in the text.  The display should look exactly like this when the user clicks the "Count words!" button:

Your output should include total word count, line count and individual word counts displayed in a text area.  Additional requirements:

(1)    A word is a sequnce of alphabets separated by non-alphabets (or the beginning or end of the string).
(2)    Word counting is case insensitive.
(3)    Words are displayed in lower cases.
(4)    Word must be listed in ascending alphabetical order.  In this example: "a", "and", "cat", "cats", ...

(2)    Consider the HTML file h5q2.html, which is displayed in IE as:

The source code of h5q2.html is:

<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" href="h5.css" type="text/css">
</head>

<body>
<p class="chapter">Chapter 1</p>
<p>This is an example for Javascript.
<div class="box">
Javascript is a scripting language used commonly in the client side, the
    browser. Microsoft has version of it known as JScript. Microsoft also has
    VBSCript, quite unrelated.
</div>
<p>Follow the instruction to work on this example. If you don't know
  how to do so, consult your classmates. </p>
<p class="chapter">Chapter 2</p>
<p>This is the end.</p>
</body>
</html>

Study both the display and the source carefully and give a reasonable definition of the file h5.css.

Do not post your work in your website.  Instead, include them in a floppy disk.