Hello,

I'm trying to add Textarea in a table cell using JavaScript, but I'm unable to do so in Firefox and Chrome. The textarea gets added in IE but not in Firefox or Chrome, in firefox and chrome the textarea appears for flash and then disappears. One more problem is if I refresh the page in IE the text in the textarea does not go, it is present even after I refresh the page. It's a very basic JavaScript function but I am not able to debug the problem. Here is the function:-

function addRow()
{
alert("height : 42px; width : 496px;");
var table = document.getElementById('tableId');
var rowCount = table.rows.length;

var row = table.insertRow(rowCount);

var cell1 = row.insertCell(0);
var textNode = document.createTextNode(rowCount + 1);
cell1.appendChild(textNode);

var cell2 = row.insertCell(1);
//var tempLabel = document.createElement("label");
var textArea = document.createElement("textarea");
textArea.setAttribute("name","option1");
textArea.setAttribute("cols","20");
textArea.style.height = "42px";
textArea.style.width = "496px";
//tempLabel.appendChild(textArea);
cell2.appendChild(textArea);
}

Are there any other best practices that I should keep in mind while doing dom manipulation.

Regards,
Abhishek