Web Page Background Color Change with Javascript

 

Complete Code

<HTML>

<HEAD>

<SCRIPT LANGUAGE=”JavaScript”>

<!– Beginning of JavaScript –

function changecolor(code) {

document.bgColor=code

}

// – End of JavaScript – –>

</SCRIPT>

 

</HEAD>

<BODY>

<form>

<input type=”button” name=”Button1″ value=”RED” onclick=”changecolor(‘red’)>

<input type=”button” name=”Button2″ value=”GREEN” onclick=”changecolor(‘green’)>

<input type=”button” name=”Button3″ value=”BLUE” onclick=”changecolor(‘blue’)>

<input type=”button” name=”Button4″ value=”WHITE” onclick=”changecolor(‘white’)>

</form>

</BODY>

</HTML>

  • Share/Save/Bookmark

Leave a Reply

Your email address will not be published. Required fields are marked *