<!DOCTYPE html>
<html>
<head>
<script src="http://code.jquery.com/jquery-latest.js"></script>
<script>
var e = 0;
function Make_input(nr,el){
for(var c=0;c<nr;c++){ e++;
$('#'+el).append('<input type="text" class="miaclasse" id="btn_'+e+'" value="btn_'+e+'"><br>');
}}
$(document).ready(function(){
Make_input(3,'s');
$(document).click(function(event){
if(e < "10"){
var tgt = $(event.target);
if($(tgt).hasClass('miaclasse')){
if($(tgt).attr('id') == 'btn_' + e){
Make_input(1,'s');
}}}});
});
</script>
</head>
<body>
<div id="s"></div>
</body>
</html>