var checks = {"1790":"1790","3462":"3462","1776":"1776","681":"681","2486":"2486","1789":"1789","1779":"1779","51":"51","686":"686","2001":"2001","669":"669","678":"678","1786":"1786","2479":"2479","1777":"1777","1785":"1785","1192":"1192","2489":"2489","1778":"1778","1792":"1792","1787":"1787","2488":"2488","1788":"1788","1244":"1244"}; $(document).ready(function(){ for (item in checks) { if ($("#C" + item)) $("#C" + item).removeClass("fa-heart-o").addClass("fa-heart"); } $("#myCounter").html('(24)') });