日期:2014-05-16 浏览次数:20436 次
<!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=utf-8" />
<title>无标题文档</title>
<script type="text/javascript" src="http://code.jquery.com/jquery-1.10.2.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$(".btn").click(function(){
var li=$(".div1 li").eq(0).clone(true);
li.insertBefore($('.div1 li').eq($('.div1 li').length-1));
})
});
</script>
<style>
*{
margin:0;
padding:0;
}
body{
font-size:12px;
}
.div{
width:650px;
float:left;
border:1px solid #DCDCDC;
padding-bottom:20px;
}
.text{
width:100px;
height:30px;
line-height:30px;
border:1px solid #DCDCDC;
float:left;
margin:20px 0 0 20px;
display:inline;
}
.div1{
float:left;
}
.div1 li{
float:left;
width:650px;
margin-top:10px;
display:inline;
height:30px;
background:#096;
}
.btn{
float:left;
}
</style>
</head>
<body>
<div class="div">
<input class="text" type="text" />
<div class="div1">
<ul>
<li></li>
</ul>
</div>
<input class="btn" type="button" value="增加" />
</div>
</body>
</html>