diff --git a/pyscriptjs/src/exceptions.ts b/pyscriptjs/src/exceptions.ts index 6201be0ba27..ef45e3ab3f3 100644 --- a/pyscriptjs/src/exceptions.ts +++ b/pyscriptjs/src/exceptions.ts @@ -2,15 +2,10 @@ const CLOSEBUTTON = ` { + banner.appendChild(closeButton).addEventListener('click', () => { banner.remove(); }); - closeButton.innerHTML = CLOSEBUTTON; - - banner.appendChild(closeButton); } document.body.prepend(banner);