Use all lower case! Notice that if you spell male or female incorrectly, the color does not change.

The Script

  <SCRIPT type="text/javascript">
    function askuser()
       answer=prompt("Are you Male or Female?")
       if ( answer == "female")
       if(answer == "male")
  <body bgcolor="lightyellow">
      <input type="button" 
	  value="Identify your Sex"  

This one was a little tough to get. I hope you were successful. You needed to change out the text in a few places, but the main thing was that you needed to change the outputs from an alert box to the document.bgColor statements to get the effect.

Please close this wondow to return to JavaScript Primer 21