Js para cambiar fondo con un click
<style> #cuadro{ width:100px; height:100px} </style> <button id='cambiar1'>verde </button> <button id='cambiar2'>amarillo </button> <div id='cuadro'>hola mundo </div> <script> document.getElementById('cambiar1').addEventListener('click', function(){ document.getElementById('cuadro').style.backgroundColor = 'green';}); document.getElementById('cambiar2').addEventListener('click', function(){ document.getElementById('cuadro').style.backgroundColor = 'yellow'}); </script>