Highlight list of words in the document using jQuery & java
<p>I am using know the following code to highlight specific word in the document </p>

<pre><code>&lt;script&gt; 
$(document).ready(function(){
   $('h1').highlight('word1');
      });
&lt;/script&gt;
</code></pre>

<p>it works fine just to highlight one word !!</p>

<p>but I have an arrylist in my program which is written in java 
ArrayList wordsList ;</p>

<p>I do not know how to make it I wrote the following </p>

<pre><code>&lt;script&gt;
         $(document).ready(function(){
          for (int y=0;y&lt;wordslist.size();y++) 
          { 
         $('h1').highlight(wordslist.get(y));
          }
     });
&lt;/script&gt;
</code></pre>

<p>it does not work , this does not highlight the words in the list </p>
