Change the document.bgColor : bgColor : Document JAVASCRIPT TUTORIALS


JAVASCRIPT TUTORIALS » Document » bgColor »

 

Change the document.bgColor

















<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>







HTML code for linking to this page:

Follow Navioo On Twitter

JAVASCRIPT TUTORIALS

 Navioo Document
» bgColor