You can use toggleClass instead of addClass/removeClass.