日期:2014-05-16 浏览次数:20447 次
<!doctype html>
<html>
<head>
<meta charset="utf-8" />
</head>
<body>
<script src="http://code.jquery.com/jquery-1.10.1.min.js"></script>
<script type="text/javascript">
$(function () {
$("#btn1").click(function(){
$("#div2").append($("#div1").clone().find("input[name='text2']").attr("value",$("#div1 input[name='text2']").val()).parent());
});
});
</script>
<div id="div1">
<input name="text1" type="text" value="111" />
<input name="text2" type="text" value="" />
</div>
<div id="div2"></div>
<input id="btn1" type="button" value="Copy" />
</body>
</html>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">