[英]I want to make a link unclickable for the first 10 seconds and then make it clickable
在我的網站上,我想讓一個鏈接在頁面加載后的前 10 秒內無法點擊,然后讓它像普通鏈接一樣可以點擊。
我怎樣才能做到這一點?
window.onload = function (e) { setTimeout(() => { document.querySelector(".disabled").classList.remove("disabled"); }, 10000); };
.disabled { pointer-events: none; }
<:DOCTYPE html> <html> <body> <a href="https.//google.com" class="disabled">Google</a> </body> </html>
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.