First:
Last:

1st Page | 2nd Page | 3rd Page | Arrays | Properties

Home | JavaScript | 3D | Old Site | Roommate | The Game | Downloads | 40th Drink | egaP | Humor | Programming | Action Research | Links | Rivard.org



How did I get your name in there? With this...

var first=window.prompt("What is your first name?", "")

var d=new Date()
var month= d.getMonth()+1
var year= d.getYear()+1900
var MyDate=month+"/"+d.getDate()+"/"+year

document.write("<TITLE>")
document.write("Hello "+first+". Today's date is"+MyDate+".")
document.write("</TITLE>")

...inside the <HEAD></HEAD> tags, and this...

document.write("Hello, "+first+", and welcome to my second javascript page.<BR>Please type your first and last name below, and click the <BR> button at the bottom of the page to continue.<P>")

...inside the <BODY></BODY> tags.

The command, window.prompt tells the computer to bring up an alert window with a text field in it. It puts whatever text the user types there into a variable, first. And yes! you can use <TITLE></TITLE> commands inside a document.write statement.

1st Page | 2nd Page | 3rd Page | Arrays | Properties

Home | JavaScript | 3D | Old Site | Roommate | The Game | Downloads | 40th Drink | egaP | Humor | Programming | Action Research | Links | Rivard.org