How to display a certain portion of a site depending on a javascript variable?
<p>Suppose I have a javascript variable "is_valid"</p>

<p>If the variable is 1, I'd like to display:</p>

<pre><code>&lt;div&gt;It's valid!&lt;/div&gt; ...and a big chunk of other code
</code></pre>

<p>Otherwise...</p>

<pre><code>&lt;div&gt;NOT valid&lt;/div&gt;...and a big chunk of other code
</code></pre>

<p>I do NOT want to use INNERHTML. I want to do it like this:</p>

<pre><code>&lt;script type="text/javascript"&gt;
    if(is_valid == 1){
&lt;/script&gt;
    It's valid!
&lt;script type="text/javascript"&gt;
    }else{
&lt;/script&gt;
    It's not valid
&lt;script type="text/javascript"&gt;
    }
&lt;/script&gt;
</code></pre>
