title: Unable to call test()
body: <p>I am new to JavaScript. <a href="http://jsfiddle.net/TLTat/41/" rel="nofollow">This is a fiddle</a> with my code.</p>
  
  <p>If I remove <code>CDATA</code> then it works fine on fiddle but create issue on XHTML editors like eclipse:</p>
  
  <pre><code>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
  </code></pre>
  
  <p>This is my JavaScript:</p>
  
  <pre><code>&lt;![CDATA[
    function test() {
        alert(document.getElementById("divId"));
        var regex = new RegExp('this',"gi");
        document.getElementById("divId").innerHTML
        = document.getElementById("divId").innerHTML.replace(regex, 
              function(matched) 
              {
                  return '&lt;span class=\'highlight\'&gt;' + matched + '&lt;/span&gt;';
              });
    }
  ]]&gt;
  </code></pre>
  
  <p>here is the <code>&lt;div&gt;</code> in question:</p>
  
  <pre><code>&lt;div id="divId"&gt;
      This is the text This is the text This is the text This is the text 
      This is the text This is the text This is the the text
  &lt;/div&gt;
  </code></pre>
  
  <p>and I am unable to call <code>test()</code> function. Any suggestions?</p>