Well, you can click with the handler clickand add a class using addClass.
$('.thing-i-will-click-on').click(function() {
$(this).addClass('selected');
});
You can also delete a class using a similar method.
$('.selected').removeClass('selected');
Combining these two things should give you the desired result.