var element = document.getElementById('element');_x000D_
_x000D_
element.onclick = function() {_x000D_
element.classList.add('backGroundColor');_x000D_
_x000D_
setTimeout(function() {_x000D_
element.classList.remove('backGroundColor');_x000D_
}, 2000);_x000D_
};
_x000D_
.backGroundColor {_x000D_
background-color: green;_x000D_
}
_x000D_
<div id="element">Click Me</div>
_x000D_