|
var whatName=prompt("Please type in your name:","");
function doName(theName){
if ((whatName != "")&&(whatName !=null)){
// you can modify this as needed
// this is the message if a name is typed in
document.writeln("Hello "+whatName+"!")
}else{
// you can modify this as needed
// this is the message if a name is *not* typed in
document.writeln("Hello!")
}
}
doName(whatName);
|