<html>  opens the html tag
<head>  opens the head tag
<title>Array Sorting Example</title>  The Title of the page, appears at the very top of the navigation screen
<script type=”text/javascript” language=”javascript” src=”sort.js”>  Tells the browser that javascript is being used
</script> closes the script tag
</head> closes the head tag
<body>  opens the body tag
<h1>Sorting String Arrays</h1>  A heading titled “Sorting String Arrays”

<p>Enter two or more names in the field below,
and the sorted list of names will appear in the
text area.</p>  a new paragraph simply instructing the user what to do
<form name=”theform”>  begins the creation of a form titled “theform”
Name:   this text simply appears on the screen
<input type=”text” name=”newname” size=”20″>  a new text field which allows up to 20 characters
<input type=”button” name=”addname” value=”Add”  creates a button labeled “Add” which runs the function “SortNames” when clicked
onclick=”SortNames();”>
<br>  line break, creates space on the page
<h2>Sorted Names</h2>  A new heading called “Sorted Names” which appears in the browser smaller than the first heading
<textarea cols=”60″ rows=”10″ name=”sorted”>  creates a text area 60 columns wide by 10 columns high
The sorted names will appear here.  this text appears initially in the text area
</textarea> closes text area tag
</form>  closes the form
</body>  closes the body
</html>  closes the html tag

Advertisement