<a href="#" class="item">Item1</a>
<a href="#" class="item">Item2</a>
<a href="#" class="item">Item3</a>
.active {
color: green;
}
var els = document.querySelectorAll('.item');
[].forEach.call(els, function(el, i, els) {
el.addEventListener('click', function() {
[].forEach.call(els, function(el) {
if(el !== this) {
el.classList.remove("active");
} else {
el.classList.add("active");
}
}, this);
});
});