Based on this answer - http://stackoverflow.com/questions/3778647/how-to-change-classes-on-click can somebody explain me what exactly the code below is doing?
$("a").click(function() {
var $this = $(this); // this is just for performance
if(!$this.hasClass('yy'))
$('.yy').toggleClass("yy").toggleClass("xx");
$this.toggleClass("yy").toggleClass("xx");
});
I mean the last two lines.