ThatManK Mobile Article

定时器关闭广告

Category: JS Tutorial: DOM实战 Published: 2026-04-07 13:58 Views: 20 Likes: 0 Comments: 0
<!DOCTYPE html>
<html lang="en">
  <head></head>

  <body>
    <img src="images/ad.jpg" alt="" class="ad" />

    <script>
      var ad = document.querySelector(".ad");
      setTimeout(function () {
        ad.style.display = "none";
      }, 5000);
    </script>
  </body>
</html>