var button1=document.getElementById('button1');
var button2=document.getElementById('button2');
button1.addEventListener('click',function(){
this.style.backgroundColor='red';
});
button2.addEventListener('click',function(){
button1.style.backgroundColor='green';
});