I have a button:
const script = document.createElement('script');
script.type = 'text/javascript';
script.async = true;
script.src ="my user snap api key";
const firstScript = document.getElementsByTagName('script')[0];
firstScript.parentNode.insertBefore(script, firstScript);
script.id = "userSnap";
I want to hide it when a certain event is called:
I have tried this but it doesnt disappear
document.getElementById('userSnap').remove()
the button is still there...
There is no css for it in it or anything so i cant adjust a css file it is just dont through user snap
Please try this
Fiddle