Sometimes input is not found with the jQuery prev selector

This issue happens when you add some html between the input and the delete button.