<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script> <script> function sample(){ google.script.run .withSuccessHandler(function(x) { var pr=new Array(); for(s=1;s<48;s++){ pr[s]="#JP-"+s; if(s<10)pr[s]="#JP-0"+s; } for(s=1;s<48;s++){ $(pr[s]).css("fill","blue"); if(x[s]>2500000)$(pr[s]).css("fill","pink"); if(x[s]>5000000)$(pr[s]).css("fill","red"); } }) .withFailureHandler(function(msg) {}) .exl(); } </script>