Reputation: 71
Is it possible to remove/disable internal JavaScript on a page after 'X' minutes so that it does not work at all after 'X' minutes of time?
Upvotes: 0
Views: 315
Reputation: 2589
Try like below,
<script type="text/javascript" id="hideAfter">
// your code here...
// it will removes the script tag after 10 sec...
setTimeout(function () {
var ele = document.getElementById("hideAfter");
ele.parentNode.removeChild(ele);
}, 10000);
</script>
Upvotes: 1