var checks = {"4002":"4002","735":"735","1772":"1772","2495":"2495","1811":"1811","3823":"3823","384":"384","4013":"4013","3996":"3996","2875":"2875","3337":"3337","2505":"2505","1799":"1799","1803":"1803","3995":"3995","1812":"1812","1145":"1145","3994":"3994","3822":"3822"}; $(document).ready(function(){ for (item in checks) { if ($("#C" + item)) $("#C" + item).removeClass("fa-heart-o").addClass("fa-heart"); } $("#myCounter").html('(19)') });