Remove the parent element when user clicks on the remove icon
In general classes are used for collections of things that should exhibit the same behaviour. Your buttons here are perfect candidates for this, so you should give them the same class name - remove-form-btn

Then give your divs a class name of form and you can write just one handler:

$('.remove-form-btn').click((event) =&gt; { 
  $(event.target).parents('.form').hide();
});