<div class="row"> <span id="status-account-year"> <span id="status-account-month"> <span id="status-account-day"> </div> 

How to cycle through .row and delete all spans that have status-account- in the identifier

 $('#status-account-???').remove(); 

Ps .: The code below does not fit, because there are other span

 $('.row').each(function(){ $(this).find('span').remove(); }); 

    2 answers 2

     $(function() { $(".row span[id*='status-account-']").remove(); }) 
     <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script> <div class="row"> <span id="status-account-year">1</span> <span id="status-account-month">2</span> <span id="status-account-day">3</span> <span id="another">4</span> </div> 

       $('.row').find('span').each(function() { const id = $(this).attr('id'); if (id.indexOf('status-account-') !== -1) { $(this).remove(); } }) 
       <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script> <div class="row"> <span id="status-account-year">1</span> <span id="status-account-month">2</span> <span id="status-account-day">3</span> <span id="another">4</span> </div>