Page Designer
Page Designer

Reputation: 71

Remove/Disable internal javascript

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

Answers (1)

Soundar
Soundar

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

Related Questions