Calling a method individually by class selector <p>In my blog I'm using Pico CMS, in the index.twig page I wrote this code that generates HTML with page title, description, and URL:</p> <pre><code>{% for page in pages|sort_by("time") %} {% if page.id starts with "blog/" %} &lt;div class="post"&gt; &lt;h3&gt; &lt;a class="page-title" href="{{ page.url }}"&gt;{{ page.title }}&lt;/a&gt; &lt;small class="date"&gt;{{ page.date }}&lt;/small&gt; &lt;/h3&gt; &lt;p class="excerpt"&gt;{{ page.description }}&lt;/p&gt; {% endif %} {% endfor %} </code></pre> <p>My idea was to make each title in a different color, I used <a href="https://github.com/davidmerfield/randomColor" rel="nofollow">randomColor</a>, and wrote this JavaScript:</p> <pre><code>$('.page-title').css('color', randomColor() ); </code></pre> <p>But this makes all the page-titles in the page to be of same color, I would like each of them in a different color. This is the website: <a href="http://blog.lfoscari.com" rel="nofollow">blog.lfoscari.com</a></p>