How to change class of element based on javascript variable value?
<p>I have the following script:</p>

<pre><code>&lt;script&gt;
  window.now = some_int_value;
&lt;/script&gt;
</code></pre>

<p>and the following html:</p>

<pre><code>&lt;span class="dot"&gt;&lt;/span&gt;&amp;nbsp;
&lt;span class="dot active"&gt;&lt;/span&gt;&amp;nbsp;
&lt;span class="dot"&gt;&lt;/span&gt;&amp;nbsp;
&lt;span class="dot"&gt;&lt;/span&gt;&amp;nbsp;
</code></pre>

<p>How should I change the style of the dot in accordance with <code>window.now</code> value? So, if it is equal to 1, then first dot should be 'dot active', if equal to 2, then second and so on.</p>
