title: Object expected error message in Javascript
body: <pre><code>&lt;script type=&quot;application/javascript&quot; language=&quot;javascript&quot;&gt;
      function showElement(elementID, show){
      var element = document.getElementById(elementID);
      if (element) {
        element.className = (show ? element.className.replace(/hidden/gi, &quot;show&quot;) : element.className + &quot; hidden&quot;);
       }
      }
  &lt;/script&gt;
          
          &lt;table cellpadding=&quot;3&quot; cellspacing=&quot;1&quot; border=&quot;0&quot; width=&quot;100%&quot;&gt;  
              &lt;tr class=&quot;baseGrayMedium&quot;&gt;
                  &lt;td colspan=&quot;2&quot;&gt;
                      (&lt;a href=&quot;javascript:void(0);&quot; onClick=&quot;showElement('evicChkLst',true);&quot; class=&quot;nostyle&quot;&gt;+&lt;/span&gt;&lt;/a&gt;|&lt;a href=&quot;javascript:void(0);&quot; onClick=&quot;showElement('evicChkLst',false);&quot; class=&quot;nostyle&quot;&gt;-&lt;/span&gt;&lt;/a&gt;) &amp;nbsp;&amp;nbsp; &lt;B&gt;Eviction Checklist&lt;/B&gt;
                  &lt;/td&gt;
              &lt;/tr&gt;
          &lt;/table&gt;
  </code></pre>
  <p>I get the Javascript error saying object expected and it points to <code>onClick</code> event in the HTML code.. Could some one suggest me why so?</p>
  <p>EDIT:</p>
  <pre><code>&lt;script type=&quot;application/javascript&quot; language=&quot;javascript&quot;&gt;
                  function showElement(elementID, show){
                      var element = document.getElementById(elementID);
                      if (element) {
                          element.className = (show ? element.className.replace(/hidden/gi, &quot;show&quot;) : element.className + &quot; hidden&quot;);
                      }
                  }
              &lt;/script&gt;
              
              &lt;table cellpadding=&quot;3&quot; cellspacing=&quot;1&quot; border=&quot;0&quot; width=&quot;100%&quot;&gt;     
                  &lt;tr class=&quot;baseGrayMedium&quot;&gt;
                      &lt;td colspan=&quot;2&quot;&gt;
                          (&lt;a href=&quot;#&quot; onclick=&quot;javascript:showElement('evicChkLst',true);&quot; class=&quot;nostyle&quot;&gt;+&lt;/span&gt;&lt;/a&gt;|&lt;a href=&quot;#&quot; onclick=&quot;javascript:showElement('evicChkLst',false);&quot; class=&quot;nostyle&quot;&gt;-&lt;/span&gt;&lt;/a&gt;) &amp;nbsp;&amp;nbsp; &lt;B&gt;Eviction Checklist&lt;/B&gt;
                      
                      &lt;/td&gt;
                  &lt;/tr&gt;
              &lt;/table&gt;
  </code></pre>
  <p>Now the code looks some thing like the above</p>