<input type="text" class="quantity" />
<button class="btn-generate">Создать</button>
<div class="inputs"></div>
<script type="text/javascript">
var quantityInput = document.querySelector('.quantity'),
btn = document.querySelector('.btn-generate'),
result = document.querySelector('.inputs');
btn.onclick = function() {
var quantity = parseInt(quantityInput.value);
if (isNaN(quantity) || quantity < 1 || quantity > 10) {
alert('Type number from 1 to 10');
return;
}
result.innerHTML = "";
for(var i = 0;i < quantity;i++) {
result.innerHTML += '<input type="text" id="dyn-input-' + i + '" placeholder="' +
'Text field number ' + (i + 1) + '"><br>';
}
}
</script>