Getting integer values and one CSS class name
First off, the question. Because some functionality is missing, I can't test my proposed solution. Try to ask self contained questions.

A possible alternative approach is to analyze the 4 integer and keep track.

function keepTrack(info, integer, cssClass){
  info[integer] = info[integer] || [];
  info[integer].push(cssClass);  
} 

info = {};
keepTrack(info, element1, 'element1-css');
keepTrack(info, element2, 'element2-css');
keepTrack(info, element3, 'element3-css');
keepTrack(info, element4, 'element4-css');


This way you have a list of items for each, you can just check how many css items there are per length and call the correct function with spread syntax.

for(integer in info){
  //You could use a switch here
  if(info[integer].length == 4)
    fourEqualElementsCss(...info[integer]);
  else if(info[integer].length == 3) 
    threeEqualElementsCss(...info[integer]);
  else if(info[integer].length == 2) 
    twoEqualElementsCss(...info[integer]);
}