<!DOCTYPE html>
<html lang="en">
<head>
<title>Rainebow Balls</title>
<style>
.addBlock{
height: 100px;
width: 100%;
border: 1px solid #000;
}
.minBlock{
float: left;
width: 20px;
height: 20px;
background-color: red;
border: 1px solid #000;
display:none;
}
</style>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.0/jquery.min.js"></script>
</head>
<body>
<input class="corners" type="range" min="1" max="60" step="1" value="48">
<span>show</span>
<div class="minBlock"></div>
<div class="addBlock">
</div>
<script>
var corners = $('.corners');
var a = corners.val(),
num = $('span');
num.text(a);
var minblock = $(".minBlock");
duplicate(a);
$(function(){
$('.corners').on('input', function(){
a = corners.val();
num.text(a);
duplicate(a);
})
})
function duplicate(count) {
$(".addBlock").html("");
for(var i = 0; i < count; i++) {
minblock.clone().appendTo(".addBlock").show();
}
}
</script>
</body>
</html>