dcsimg

Assignment 23: A Possible Answer

This:

<SCRIPT LANGUAGE="JavaScript">

function readit()
{
var fn = document.myform.thebox.value
var ln = document.myform.the2ndbox.value

alert("Hello " + fn + " " + ln + "!")

}
</SCRIPT>

<FORM NAME="myform">
Write your first name in the box:
<INPUT TYPE="text" NAME="thebox">
Write your Last name in the box:
<INPUT TYPE="text" NAME="the2ndbox">
<INPUT TYPE="button" VALUE="Then Click Here" onClick="readit()">
</FORM>

 

Gives you this:

Write your first name in the box:
Write your last name in the box:

     Look the script over -- can you pick out what made the changes?

 

Did You Get It?

 

Back to the Index Page