<div class="place">1</div>
<div class="place">2</div>
<div class="place">3</div>
var places = document.querySelectorAll('.place'),
freePlaces = [1, 3];
[].forEach.call(places, function (place) {
freePlaces.indexOf(+place.textContent) > -1 && place.classList.add('free');
});