I have four html elements that, when clicked, they want to apply me to a specific class. The problem is that this class is only for one out of four at any given time. I want this class to be deleted from three other elements when I click on one element and applied to the one that was clicked. If I were to start a cycle that removed this class from each individual element before applying this class to the element that was clicked, would an error be detected in elements that do not have this class?
source
share