score:0

Accepted answer

Solution:

   function handleElement(i) {
        document.getElementById('wordcloud_' + i + '_im').onclick=function(d,e) {
            wordcount = 40;
            x=i;
            console.log("x :" + x);
            wordclouds(keyfile,start=(x-1)*wordcount,stop=x*wordcount);

        };
    }

     for(i=1; i<35; i++) 
        handleElement(i);

Related Query