JScript error: Cannot assign to a function result
<p>In my application I am trying to hide a table based on a condition.
I am using  simple javascript function to hide the table.</p>

<p>the function is failing on the following line</p>

<pre><code>if ((image1.trim() = '') &amp;&amp; (image2 != '1')) {
</code></pre>

<p>giving error </p>

<blockquote>
  <p>'Microsoft JScript runtime error: Cannot assign to a function result'.</p>
</blockquote>

<p>Here is the code.</p>

<p>Html code:</p>

<pre><code> &lt;table id="tblImage" cellpadding="0" cellspacing="0" style="padding:2px 0px"&gt;
            &lt;tr&gt;                
                &lt;td&gt;
                    &lt;div id="otherImages"&gt;&lt;/div&gt;
                &lt;/td&gt;
            &lt;/tr&gt;
     &lt;/table&gt;   
</code></pre>

<p>Javascript function: </p>

<pre><code>function DisplayTable() {
    var image1 = document.getElementById('ctl00_ContentPlaceHolder1_image1').value;
    var image2 = document.getElementById('ctl00_ContentPlaceHolder1_image2').value;
    if ((image1.trim() = '') &amp;&amp; (image2 != '')) {
         jQuery('#tblImage').hide();
    }
}
</code></pre>
