i have this
$(".picker").click(function(e) {
var imgID = $(this).attr("data-imgID");
$('body').addClass('picker-' + imgID);
});
<span class="taPicker" data-imgID="0"></span>
<span class="taPicker" data-imgID="1"></span>
<span class="taPicker" data-imgID="2"></span>
i want to toggle between generic classes on body element, for example if you click on .picker i want to add a unique class to body element based on the data-imgID attribute
But, how can i prevent the duplication's? for example if you click on another .picker i want to remove the previous class and add a new one