是否可以在'X'分钟后删除/禁用页面上的内部JavaScript,以便在'X'分钟后它根本不起作用?
答案 0 :(得分:1)
尝试如下,
<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>