Change the document.bgColor : bgColor « Document « JavaScript Tutorial






<html>
    <form>
    <input type="button"
           value="Yellow"
           name="Yellow"
           onClick="changeBG('yellow')">
    <input type="button"
           value="Green"
           name="Green"
           onClick="changeBG('green')">
    <input type="text"
           name="color">
    </form>
    <script language="JavaScript">
    <!--
    function changeBG(color)
    {
      document.bgColor=color;              //Change background color

      document.myForm.color.value=color;   //Display the  color
    }
    -->
    </script>
    </html>








14.6.bgColor
14.6.1.document.bgColor
14.6.2.Change the document.bgColor