<script language="javascript" type="text/javascript">
function appendit()
{
var utable = document.getElementById("utable");for (var i=0; i<1; i++)
{
var currentRow = utable.insertRow();
for (var j=1; j<3; j++)
{
var button = document.createElement("<input id=\"b"+j+"\" name=\"b"+j+"\" type='button' value=\"AppendButton"+j+"\">");
button.onclick = function () { alert(this.id); }
button.onblur = function () { alert(this.id);}
var currentCell = currentRow.insertCell();
currentCell.appendChild(button);
}
}
}
</script>
</HEAD><BODY onload="appendit();">
<TABLE id="utable" name="utable" width="20%" align="center" border="1">
<TR>
<TD>asdasd</TD>
<TD>asdasd</TD>
</TR>
<TR>
<TD>asdfasd</TD>
<TD>asdfad</TD>
</TR>
</TABLE>
</BODY>
</HTML>
function appendit()
{
var utable = document.getElementById("utable");for (var i=0; i<1; i++)
{
var currentRow = utable.insertRow();
for (var j=1; j<3; j++)
{
var button = document.createElement("<input id=\"b"+j+"\" name=\"b"+j+"\" type='button' value=\"AppendButton"+j+"\">");
button.onclick = function () { alert(this.id); }
button.onblur = function () { alert(this.id);}
var currentCell = currentRow.insertCell();
currentCell.appendChild(button);
}
}
}
</script>
</HEAD><BODY onload="appendit();">
<TABLE id="utable" name="utable" width="20%" align="center" border="1">
<TR>
<TD>asdasd</TD>
<TD>asdasd</TD>
</TR>
<TR>
<TD>asdfasd</TD>
<TD>asdfad</TD>
</TR>
</TABLE>
</BODY>
</HTML>
<head>
<script language="javascript" type="text/javascript">
function appendTable()
{
var table1 = document.getElementById("Table1");
var currentRow = table1.childNodes[0];
var newRow = currentRow.cloneNode(true); //copy a row including its child nodes
var childs = newRow.getElementsByTagName("input");
childs[0].onclick=function(){
alert('getValue(a2)');
}; childs[0].onblur=function(){
alert('clear(a2)');
}; table1.appendChild(newRow);
}
</script>
</HEAD><BODY onload="appendTable();">
<TABLE id="Table1" width="20%" align="center" border="1">
<TR>
<TD><input type="text" onclick="alert('getValue(a1)');" onblur="alert('clear(a1)');"/></TD>
</TR>
</TABLE>
</BODY>
</HTML>