ch04
This commit is contained in:
@@ -0,0 +1,45 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||
<html>
|
||||
<head>
|
||||
<title>Example 4.10</title>
|
||||
<script>
|
||||
function getClass()
|
||||
{
|
||||
document.write('<table width="40%" align = "center">');
|
||||
var fname = " ";
|
||||
var lname = " ";
|
||||
var id = " ";
|
||||
var username = 0;
|
||||
var course = " ";
|
||||
course = prompt("What is the name of this course?");
|
||||
document.write('<tr><td colspan =4 align = "center">' + course + '</td></tr>');
|
||||
document.write('<tr><td>first name</td><td>last name</td><td>ID number</td><td>username</td></tr>');
|
||||
//fname = prompt("Enter one student's first name:");
|
||||
//lname = prompt("Enter the student's last name:");
|
||||
id = prompt("Enter the student's identification number:");
|
||||
do
|
||||
{
|
||||
fname = prompt("Enter another student's first name or enter 'X' when finished:");
|
||||
lname = prompt("Enter another student's last name or enter 'X' when finished:");
|
||||
username = fname + id;
|
||||
document.write('<tr><td>' + fname + '</td><td>' + lname + '</td><td>' + id + '</td><td>' + username + '</td></tr>');
|
||||
id = prompt("Enter another student's identification number or enter -9 when finished:");
|
||||
}
|
||||
while (id != -9)
|
||||
document.write('</table>');
|
||||
}
|
||||
</script>
|
||||
</<head>
|
||||
<body>
|
||||
<table align ="center" width ="70%"><tr><td colspan ="2">
|
||||
<h1> </h2>
|
||||
<h1>Create Usernames</h1>
|
||||
<p>You can enter each student's name and ID number and <br />
|
||||
this program will create usernames for you</p>
|
||||
<tr><td><p> </p>
|
||||
<p><input type="button" id="username" value="Click to begin entering names" onclick="getClass();" /></p>
|
||||
</td></tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
|
@@ -0,0 +1,15 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||
<html>
|
||||
<head>
|
||||
<title>Example 4.11</title>
|
||||
<script>
|
||||
var name = "MaryAnn";
|
||||
var greeting = "Welcome home, ";
|
||||
document.write('<p>' + greeting + name + '!</p>');
|
||||
document.write('<p>' + greeting.toUpperCase() + name.toLowerCase() + '!</p>');
|
||||
document.write('<p>' + greeting.toLowerCase() + name.toUpperCase() + '!</p>');
|
||||
</script>
|
||||
</<head>
|
||||
|
||||
</html>
|
||||
|
@@ -0,0 +1,15 @@
|
||||
<!DOCTYPE html>
|
||||
<!--
|
||||
Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
|
||||
Click nbfs://nbhost/SystemFileSystem/Templates/Other/html.html to edit this template
|
||||
-->
|
||||
<html>
|
||||
<head>
|
||||
<title>TODO supply a title</title>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
</head>
|
||||
<body>
|
||||
<div>TODO write content</div>
|
||||
</body>
|
||||
</html>
|
Reference in New Issue
Block a user