I have a section of jQuery code that I am having to repeat over and over with only a small change accompanying each iteration. Here is an example of what I have:
if($('.smm').hasClass('vendor-icon-active')) {
total = total + 1200;
} else {
total = total;
}
if($('.repman').hasClass('vendor-icon-active')) {
total = total + 495;
} else {
total = total;
}
if($('.blog-management').hasClass('vendor-icon-active')) {
total = total + 395;
} else {
total = total;
}
if($('.press-release').hasClass('vendor-icon-active')) {
total = total + 195;
} else {
total = total;
}
In my code, I have about 30 of those sections. Is there a way I could simplify that process and clean up my code?