The javascript should be wrapped within its tags and placed I would say at page level, inside the custom code section and before the end of the tag.
The HTML should simply be an Webflow embed, placed somewhere inside your form. It wont be visible since the input has a type “hidden”.