Add the class only to the previous element not all of them?

Add the class only to the previous element not all of them?

Hi,

Looking at this Pen, I'm trying to achieve that if an input-field is checked only the element with the class "js-booking-list__header" which is before the input-field should get a class added. But all other elements with the class "js-booking-list__header" which are in DOM after the the checked input-field shouldn't get the new class.


However it's not working as it should.
What am I doing wrong?

Thanks