JSFiddle - React, Tailwind, and code Playground
HTML
<div id="r">3121</div>
<div id="g">2334</div>
<div id="b">3445</div>
<div id="a">4121</div>
JavaScript
var vals = [];
$('#r, #g, #b, #a').each(function(i){
vals[i] = $(this).text();
});
var min = Math.min.apply(Math, vals);
alert(min);