背景色を変更するサンプルプログラムです.
<SCRIPT LANGUAGE="JavaScript">
<!--
function BackColor( Clr ){ //(1)
document.bgColor = Clr; //(2)
}
//-->
</SCRIPT>
背景色を選んで下さい.
<FORM> //(3)
<INPUT TYPE=button NAME="pBtn" VALUE="青色" ONCLICK="BackColor(0x0000ff)"> //(4)
<INPUT TYPE=button NAME="pBtn" VALUE="緑色" ONCLICK="BackColor(0x00ff00)">
<INPUT TYPE=button NAME="pBtn" VALUE="赤色" ONCLICK="BackColor(0xff0000)">
<INPUT TYPE=button NAME="pBtn" VALUE="黒色" ONCLICK="BackColor(0x000000)">
<INPUT TYPE=button NAME="pBtn" VALUE="白色" ONCLICK="BackColor(0xffffff)">
</FORM>