HTMLElement newRow = (HTMLElement)pattern.cloneNode(true);
newRow.setAttribute("id","row-" + rows);
newRow.setAttribute("style","display:block;color:red;");
HTMLInputElement inputElem = (HTMLInputElement)doc.getElementById("add-row-value");
newRow.appendChild(doc.createTextNode(rows + " - " + inputElem.getValue()));
rows++;
itsNatDoc.setUserValue("rows",new Integer(rows));
Element parent = doc.getElementById("rows");
parent.appendChild(newRow);