dcsimg

Lesson 25: The Script and Its Effect



The Script

<SCRIPT LANGUAGE="JavaScript">

function newcolor(color)
{
alert("You Chose " + color)
document.bgColor=color
}
</SCRIPT>
<h3>Select a Background Color</h3>

<FORM>
<INPUT TYPE="button" VALUE="Blue" onClick="newcolor('lightblue')">
<INPUT TYPE="button" VALUE="Pink" onClick="newcolor('pink')">
</FORM>

 

The Script's Effect

Select a Background Color

 

Back to the Index Page