Answer the question
In order to leave comments, you need to log in
How to organize the correct withdrawal of tickets?
There is such a problem:
There is a list of tickets
<div class="place">1</div>
<div class="place">2</div>
<div class="place">3</div>
Answer the question
In order to leave comments, you need to log in
var places = document.querySelectorAll('.place'),
freePlaces = [1, 3];
[].forEach.call(places, function (place) {
freePlaces.indexOf(+place.textContent) > -1 && place.classList.add('free');
});
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question