I am adding input dynamically using jQuery. After that i am trying to use focus event to generate yet another input group. Here is the jsfiddle (http://jsfiddle.net/sk8UG/) and the snippet is below
HTML:
<div class='row' id='addChild'>
<input type='name' name='child0' id='child0'>
<input type='name' name='phone0' id='phone0'>
</div>
JS:
$(document).ready(function(){
$("#child0").focus(function() {
$('#addChild').append("<input type='name' name='child1' id='child1'><input type='name' name='phone1' id='phone1'>");
});
$("#child1").focus(function() {
$('#addChild').append("<input type='name' name='child2' id='child2'><input type='name' name='phone2' id='phone2'>");
});
});
On focus of #child0 it will create #child1. But, on focus of #child1, it does nothing