<html>
<head>
</head>
<body>
<div id="x" style="width: 50px; height: 50px; background: #B4BDB9">
</div>
<a href="javascript://" onclick="press();">
Сменить цвет
</a>
<script type="text/javascript">
var pressed = false;
function press() {
pressed = !pressed;
document.getElementById('x').style.backgroundColor = pressed ? '#939c93': '#B4BDB9';
}
</script>
</body>
</html>