dcsimg

Assignment 25: A Possible Answer

This:

<SCRIPT LANGUAGE="JavaScript">
function thePage(page)
{
document.daform.receiver.value=("You chose " +page+ ".");
document.bgColor=page;
}
</SCRIPT>
<h3>The Information you Requested...</h3>
<FORM NAME="daform">
<center><INPUT TYPE="text" SIZE="40" name="receiver"></center><P>
<INPUT TYPE="button" VALUE="Blue" onClick="thePage('blue')">
<INPUT TYPE="button" VALUE="Yellow" onClick="thePage('yellow')">
<INPUT TYPE="button" VALUE="Green" onClick="thePage('green')">
</FORM>

 

 

Gives you this:

The Information You Requested...

     See how the text got into the text box? We're passing up what the user chose.

 

Did You Get It?

 

Back to the Index Page