Change the different background color of p tags
<pre><code>&lt;div id="r_1" class="white"&gt;&lt;/div&gt;
&lt;div id="r_2" class="black"&gt;&lt;/div&gt;
&lt;div id="r_3" class="blue"&gt;&lt;/div&gt;
&lt;div id="r_4" class="red"&gt;&lt;/div&gt;
&lt;div id="r_5" class="green"&gt;&lt;/div&gt;
&lt;div id="r_6" class="white"&gt;&lt;/div&gt;

&lt;p id="p_r_1"&gt; some...&lt;/p&gt;
&lt;p id="p_r_2"&gt; some...&lt;/p&gt;
&lt;p id="p_r_3"&gt; some...&lt;/p&gt;
&lt;p id="p_r_4"&gt; some...&lt;/p&gt;
&lt;p id="p_r_5"&gt; some...&lt;/p&gt;
&lt;p id="p_r_6"&gt; some...&lt;/p&gt;
</code></pre>

<p>On each div click, I need to change the different background color of <code>p</code> tags respectively.
Sometimes the count of number of <code>div</code> &amp; <code>p</code> tags may vary.</p>
