function deleteElement() { var line = $('#line'); var action = $('#action').find('.row'); if(action.length > 1) { line.remove(); } }