var countNewFields = $('#newFields input').length; if(countNewFields > 0){ $('#remove').fadeIn(); }else{ $('#remove').hide(); }