Setting the display property to none will terminate any running animation applied to the element and its descendants. If an element has a display of none, updating display to a value other than none will start all animations applied to the element by the animation-name property, as well as all animations applied to descendants with display other than none.
const scriptTag = document.createElement('script')
scriptTag.src = `https://www.google.com/recaptcha/api.js?render=${recaptchaKey}`
scriptTag.async = true
scriptTag.defer = true
scriptTag.addEventListener('load', () => {
// тут можно добавить обработчик
})
document.body.appendChild(scriptTag)
document.body.innerHTML += твойтег