Use the .not
method:
$(".dist_radio").not(this).attr("class", "dist_radio");
But for your logic, you could just do like below (use addClass
/removeClass
instead of changing the class
attribute directly):
$(".dist_radio").click(function() {
$(".dist_radio").removeClass('dist_on');
$(this).addClass('dist_on');
});