var oInput = document.createElement("INPUT");
oForm.appendChild(oInput);
with ( oInput )
{
type = "text";
name = "txt1";
value = "default value";
className = "inputclass1";
}
var oButton = document.createElement("INPUT");
oForm.appendChild(oButton);
with ( oButton )
{
type = "button";
name = "btn1";
value = "button1";
className = "buttonclass1";
}
var oForm = document.createElement("FORM");
oDiv.appendChild(oForm);
this.oForm = oForm;
with ( this )
{
oForm.target = "_self";
oForm.action = "www.xx.com";
oForm.method = "post";
oForm.onsubmit = "return SubmitFunc();";
}
var oInput = document.createElement("INPUT");
this.oForm.appendChild(oInput);
with ( oInput )
{
type = "text";
name = "txt1";
value = "default value";
className = "inputclass1";
}
var oButton = document.createElement("INPUT");
this.oForm.appendChild(oButton);
with ( oButton )
{
type = "button";
name = "btn1";
value = "button1";
className = "buttonclass1";
}
<input onclick="add()" value=add type=button>
<table id=mxh></table>
<script>
var a=0
function add()
{
var o = document.getElementById("mxh")
var r = o.insertRow(o.rows.length)
var c = r.insertCell()
c.innerHTML = "<input name=mxh" + a + " onclick='alert(this.name)'>"
a++
}
</script>