How to convert PHP simple if statement to Javascript?
<p>I would like to set a random field like in PHP e.g. 1-3 and do the code for each state, however I do not know ho to do the same using javasccript. Is it possible, how to do such thing? Thanks in advance.</p>

<pre><code>            &lt;?php $random = rand(1,3); ?&gt;

            &lt;?php if ($random == 1) : ?&gt; 
                &lt;div id="myContent"&gt;
                &lt;/div&gt;
            &lt;?php endif; ?&gt;

            &lt;?php if ($random == 2) : ?&gt; 
                &lt;div id="myContent2"&gt;
                &lt;/div&gt;
            &lt;?php endif; ?&gt;

            &lt;?php if ($random == 3) : ?&gt; 
                &lt;div id="myContent3"&gt;
                &lt;/div&gt;
            &lt;?php endif; ?&gt;
</code></pre>
