cell = document.createElement("td"); cell.className = "TreeViewText"; cell.appendChild(celltext); row = document.createElement("tr"); row.appendChild(cell); celltext = document.createTextNode("remove"); anchor = document.createElement("a"); anchor.onclick = new Function("RemoveSelectedItem('" + String(i) + "')") anchor.className = "TreeViewTextAnchor" anchor.appendChild(celltext); cell = document.createElement("td"); cell.appendChild(anchor); row.appendChild(cell);