Template loads via jQuery .load(), but no {% js %} tags are included
In Craft 3, the {% js %} tag places the javascript code just before the closing &lt;/body&gt; tag in the rendered HTML document by default.

This means that the rendered &lt;script&gt; tag will not be in the #newAddressForm element, but will be rendered just before the closing &lt;/body&gt; tag.

So if you are loading the rendered template using jQuery's .load() function and specifying the #newAddressForm element, the &lt;script&gt; tag will be excluded from the injected code as it isn’t within the #newAddressForm element.

Your best bet is to inline the &lt;script&gt; tag within the Twig template rather than using the {% js %} tag to include it. That way you can ensure that the code will be included in the #newAddressForm element as you need it.

More details of the {% js %} tag can be found in the Craft 3 docs: https://docs.craftcms.com/v3/dev/tags/js.html