Advertisement
Guest User

Untitled

a guest
Feb 25th, 2020
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. <div id="counter">5</div>
  2. <script>
  3. setInterval(function() {
  4. var div = document.querySelector("#counter");
  5. var count = div.textContent * 1 - 1;
  6. div.textContent = count;
  7. if (count <= 0) {
  8. window.location.replace("https://google.com");
  9. }
  10. }, 1000);
  11. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement