Сообщение от alchin
|
как это сделать?
|
Например так...
<!DOCTYPE html>
<html ng-app>
<head>
<script src='http://code.jquery.com/jquery-latest.js'></script>
<!--
<script src="http://code.angularjs.org/1.1.4/angular.min.js"></script>
<link rel='stylesheet type=text/css href=tmp.css' />
-->
<style type='text/css'>
.item:last-child {
display: none;
}
</style>
<script type='text/javascript'>
$(function(){
$('button').click(function(){
var n=+$('[name="amt"]').val();
$('.item:visible').remove();
for (var i=0; i<n; i++) {
$('.item:last').before($('.item:last').clone());
};
});
})
</script>
</head>
<body>
<input type="text" name="amt" />
<button>Go</button>
<div id='container'>
<div class='item'>
<input type="text" name="size" />
<input type="text" name="color" />
</div>
</div>
</body>
</html>