|
Book Section

General Section

Other Sites

|
JavaScript Workshop Forums
| View previous topic :: View next topic |
| Author |
Message |
mayorvlf New member

Joined: 14 Jul 2012 Posts: 3 Location: Dallas, TX
|
Posted: Sat Jul 14, 2012 1:17 pm Post subject: JavaScript Simple assignemt |
|
|
Hello,
I have to create a simple JavaScript where I prompt the user to enter 2 names and then send those names to a functions named Greet with 2 parameters and display the 2 names. Below it is my code:
<html>
<head>
<title>Greeting</title>
<script LANGUAGE="JavaScript">
function Greet (who1, who2){
alert("Greetings, " + who1 + " " + who2)
}
</script>
</head>
<body>
<script type="text/javascript">
var name1=prompt("What is your name?");
var name2=prompt("What is your Last name?");
Greet(name1, name2);
</script>
</body>
</html>
Does anyone know of a more simple way of accomplishing this task? |
|
| Back to top |
|
 |
phil karras Senior Member

Joined: 15 Jul 2002 Posts: 1776 Location: MD
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2002 phpBB Group
|
|
(c) 1997-2002 Starling Technologies and
Michael Moncur. Portions (c) Sams Publishing.
|
|
|