function sure(key){
var bt1 = document.getElementById('bt1');
var bt2 = document.getElementById('bt2');
bt1.style.backgroundColor="";
bt2.style.backgroundColor="";
if(key==1){
bt1.style.backgroundColor="red";
}else {
bt2.style.backgroundColor="red";
}
}
<input type="button" id="bt1" onclick="return sure(1)" value="按钮1">
<input type="button" id="bt2" onclick="return sure(2)" value="按钮2">