日期:2014-05-16 浏览次数:20393 次
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=gb2312" />
<title>无标题文档</title>
<script type="text/javascript">
function addObj()
{
var inputText = "<input type='text' name='text' />";
var html=document.getElementById("div1");
html.innerHTML = html.innerHTML+inputText;
}
</script>
</head>
<body>
<form id="from1" action="" method="get">
<div id="div1">
</div>
<input type="button" value="添加文本框" onclick="addObj()" />
<input type="submit" value="提交"/>
</form>
</body>
</html>
var html=document.getElementById("div1");
var input = document.createElement("INPUT");
input.setAttribute("name","text");
input.setAttribute("type","text");
html.appendChild(input);
function addObj() {
var input = document.createElement('input');
input.name = 'text';
input.type = 'text';
document.getElementById("div1").appendChild(input)
}
text=replace(request("text"),",","&&")