How can I make a conditional swap with jQuery on click. If certain class is present swap it to another, for example swap class "A" to "B".

```
<a href="#" id="clickMe"><span class="A"></span>link</a>

```

I've been trying this but it does not seem to work:

```
$(this).closest("span").toggleClass("A,B");

```

What am I missing?