How do I escape html in the "innerHtml" property with javascript?
<p>I have a combo of javascript and my jsp that is adding some text and escaping it.  I also have some javascrpt that will allow me to edit the text after it has been submitted.  However the html renders when Click the edit button.</p>

<pre><code>    function editCommentToggle( id )
{
    theRow = document.getElementById("id"+id);
    //user = theRow.cells[0].innerHTML;
    //date = theRow.cells[1].innerHTML;
 --&gt;   com = theRow.cells[2].innerHTML;


    idx = 2;
    maxlength = 250;

                // Comment field
        cell = theRow.cells[idx];
        while( cell.childNodes.length &gt; 0 ) cell.removeChild(cell.childNodes[0]);
        element = document.createElement("textarea");
        element.id="comments-"+id;
        element.rows="3";
        element.value = com;
        element.style.width = "400px";
        element.maxLength = "250";
        element.onfocus = element.onkeydown = element.onkeyup = function(){return characterCounterEdit(undefined, maxlength, this);}; 
        cell.appendChild(element);
</code></pre>

<p><strong>"theRow.cells[2].innerHTML;"</strong> is grabbing the text or html in that cell, but if say there is a 'newline' it displays a<code>&lt;br&gt;</code>.....how should I structure this to preserve the escaped html??</p>

<p>thanx</p>
