<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
</head>
<script>
function a(obj)
{
document.body.innerHTML+="<input type='text'>"
}
</script>
<body>
<input type="button" value="点击" onclick="a(this)">
</body>
也可以先隐藏一个TEXT,点按钮了让它显示就行了.
document.textpath.innerHTML+="<input type='text'>"
因此要么用隐藏/显示的解决方案,
要么用
function a(obj)
{
var newinput=document.createElement("input");
newinput.setAttribute("type","text");
obj.parentNode.insertBefore(newinput,obj);
}