How to remove class if clicking outside of element?

Good evening.
There are 9 items by clicking on one of them, it adds the class active how to make so that at a clique on other element class with the first removed, but to that which is clicked to be added?
d1168464458a4fcfa891d0a859e3f9c2.png
July 8th 19 at 15:35
0 answer

Find more questions by tags JavaScript