<script>
function kolorTla(kolor){
document.getElementById("div1").style.backgroundColor = kolor;
}
</script>
<input type="button" value="Czerwony" onClick="kolorTla('red')">
<input type="button" value="Niebieski" onClick="kolorTla('blue')">
<br><br>
<div id="div1" style="height: 500px; width: 500px; background-color: blue;"></div>