variable classname in javascript in loop
<p>in Javascript, I have a row of elements with identical div's:</p>

<pre><code>(....loop, where "count" is a number that can distinguish the columns in the row)
&lt;other divs&gt;
  &lt;div class="pie"&gt;&lt;/div&gt;
&lt;/div&gt;
</code></pre>

<p>and then I am doing something like this:</p>

<pre><code> &lt;% var strng = 'rotate 40deg' %&gt;
 &lt;% $("other divs... .pie").css({'-webkit-transform': strng}); %&gt;
</code></pre>

<p>so that I can rotate each individual element. The problem is, since my Javascript selector just does "pie", all the individual column elements get rotated the same amount.</p>

<p>It seems that I want something like this:</p>

<pre><code>&lt;other divs&gt;
  &lt;div class"pie"&gt;
    &lt;div class=count&gt;&lt;/div&gt;
  &lt;/div&gt;
</code></pre>

<p>and then the selector would be something like this:</p>

<pre><code>&lt;% $("other divs... .pie" + " ." + count).css({'-webkit-transform': strng}); %&gt;
</code></pre>

<p>but this doesn't seem to work. How can I use a variable class name?</p>

<p>EDIT: count is just a number. I will add a string in front of the number and see if that works - thanks for noting that a class name can't start with a number.</p>

<p>EDIT: I'd like to understand why I am losing points for this question. It's a serious question and I need to figure it out. I closed it, even though I didn't get an answer that works yet. I suppose the question just looked stupid to people?</p>

<p>EDIT: there is now a JSFiddle. I need to get it working initially - and then I will add the things I am trying to work out.</p>

<p><a href="http://jsfiddle.net/VJHcH/12/" rel="nofollow">http://jsfiddle.net/VJHcH/12/</a></p>
