定时器关闭广告

Tutorial: DOM操作 Category: JS Published: 2026-04-07 13:58:26 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>