JsFiddle has a nice demo but only works up to jquery 1.8. Here is the link: http://jsfiddle.net/tZPg4/12409/
Add Another Input Box
$(function() {
var scntDiv = $('#p_scents');
var i = $('#p_scents p').size() + 1;
$('#addScnt').on('click', function() {
$('<p><label for="p_scnts"><input type="text" id="p_scnt" size="20" name="p_scnt_' + i +'" value="" placeholder="Input Value" /></label> <a href="#" id="remScnt">Remove</a></p>').appendTo(scntDiv);
i++;
return false;
});
$('#remScnt').on('click', function() {
if( i > 2 ) {
$(this).parents('p').remove();
i--;
}
return false;
});
});
Version 1.9, it needs Migrate 1.1.0 to be able to have "Remove" work as expected.
Version 1.10 and later won't work for both .live and .on