I\'m a bit confused as to why this isn\'t working; I assume that because I\'m adding the class and its not being added back into the collection I\'m not sure.
Here i
You can also change your click handler to the live click handler:
$(document).ready(function () {
$('.optional').live('click',function () {
$(this).removeClass('optional').addClass('selected'); return false;
});
$('.selected').live('click',function () {
$(this).removeClass('selected').addClass('rejected'); return false;
});
$('.rejected').live('click',function () {
$(this).removeClass('rejected').addClass('optional');
});
});