This is actually a bit complicated, you need to get an array with numbers from .sum elements, then find the largest number, then remove everything from the array, then find the next highest number and finally specify all elements containing these two numbers.
In code, it will look like
var sum = $('.sum'); var arr = sum.map(function(_,x) { return +$(x).text() }).get(); var max = Math.max.apply( Math, arr ); var out = arr.filter(function(x) { return x != max }); var nxt = Math.max.apply( Math, out ); sum.filter(function() { var numb = +$(this).text(); return numb == max || numb == nxt; }).css('font-weight', 'bold');
Fiddle
source share