How to append classes for dynamic terms in jquery? I have installed a rating module, there I want to change the style. for that what I need is
there is a css class called 

$('.rate-widget-fivestar)


there are totally 3 widgets. the value of five star increses to 1,2,3 for three widgets respectively.

I want to add a class for each widget.
(ie)

if($('.rate-widget-1))
 {  //class 1
 }
 if($('.rate-widget-2))
 {  //class 2
 }
 if($('.rate-widget-3))
 {  //class 3
 }


how can i acheive that in jquery??
I hope below code works for you.

if ($('.rate-widget-fivestar').hasClass('rate-widget-1')) {
  $(this).addClass('class1');
}

if ($('.rate-widget-fivestar').hasClass('rate-widget-2')) {
  $(this).addClass('class2');
}

if ($('.rate-widget-fivestar').hasClass('rate-widget-3')) {
  $(this).addClass('class3');
}