I was trying to use this:
But it seems that the jQuery version he is using is quite outdated.
However, the only necessary update I see in his code is to change .live() to .on(). But the remove button refused to work if I changed so.
$('#remScnt').on('click', function() {
if( i > 2 ) {
$(this).parents('p').remove();
i--;
}
return false;
});
Anyone has any idea why?