Based on the "Add-more button (with graceful degradation)" example available in Drupal examples module I have created a form that can add fields dynamically using AJAX, and now i want to add a separate Remove button to each of those fields so that i can remove individual fields (not just the last field).

Decrementing the number of fields and rebuilding the form only removes the last field in the form.

What's the Drupal way of doing this? and what would be the best approach to achieve my requirement?