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.
function editCommentToggle( id ) { theRow = document.getElementById("id"+id); //user = theRow.cells[0].innerHTML; //date = theRow.cells[1].innerHTML; --> com = theRow.cells[2].innerHTML; idx = 2; maxlength = 250; // Comment field cell = theRow.cells[idx]; while( cell.childNodes.length > 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); "theRow.cells[2].innerHTML;" is grabbing the text or html in that cell, but if say there is a 'newline' it displays a<br>.....how should I structure this to preserve the escaped html??
thanx