Web Page Background Color Change with Javascript


Complete Code




<!– Beginning of JavaScript –

function changecolor(code) {



// – End of JavaScript – –>






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




  • Share/Save/Bookmark

Leave a Reply

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