Assignments 3 (paper submission due Wednesday, October 6 in class):

The following assignment should be hand-written and submitted in class.

1. Write a web page with JavaScript that checks if a password text field has any value when submitted. (2)

2. The following web page is indended to print out the squares of the numbers 1 to 10. What is the output of this program. Indicate errors in the program (with short explanations). Do not run the program! (3)

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<HTML>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>JavaScript Example</title>
</head>

<body>

<script type="text/javascript" language="javascript">
<!--
document.write("<p> hello1 </p>");
n=11;
for (n=1; n<=10; n=n++){
document.write("<p><h1>" + n + "..." + n*n + "</p></h1>");
}

// -->
</script>

</body>
</HTML>