title: Make a page redirect when a number is 15 using if statements
body: <p>I want to make a piece of code redirect the user to a certain website after 15 is reached by a number. I would use the code below and it would not redirect even if the number is met.</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;!DOCTYPE html&gt;
  &lt;html lang="en"&gt;
  &lt;head&gt;
      &lt;title&gt;Document&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
      &lt;h1 id="text"&gt;please wait &lt;span id="thing" style="font-size: 70px;"&gt;0&lt;/span&gt; seconds&lt;span id="wait"&gt;&lt;/span&gt;&lt;/h1&gt;
      &lt;script&gt;
          var request = document.getElementById("thing");
          var num = 0;
          var goup = setInterval(function goUp() {
              num++;
              request.innerHTML = num;
          }, 1000)
          var dots = window.setInterval(function dots() {
              var waiter = document.getElementById("wait");
              if (waiter.innerHTML.length &gt; 5) {
                  waiter.innerHTML = ""
              } else {
                  waiter.innerHTML += ".";
              }
          }, 100)
          if (num.innerHTML === 15) {
              location.href('https://google.com/');
          }
      &lt;/script&gt;
  &lt;/body&gt;
  &lt;/html&gt;</code></pre>
  </div>
  </div>
  </p>