<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script> <script> function sample(){ n=1; google.script.run .withSuccessHandler(function(x) { str="<img src=\"https://drive.google.com/uc?export=view&id="+x[1]+"\"/>"; $("#memo").html(str); $('#memo').click(function(){ n=n+1; str="<img src=\"https://drive.google.com/uc?export=view&id="+x[n]+"\"/>"; $("#memo").html(str); }); }) .withFailureHandler(function(msg) {}) .step(); } </script>