title: Why my code doesn't work on IE and it work fine in Chrome? Where do I make mistake?
body: <p>Why my code doesn't work on IE and it work fine in Chrome? Where do I make mistake? I want it load in Internet Explorer, not chrome. Is it because &quot;window.onload=new function&quot; not work on Internet explorer?</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;div id="time" style="font-size: 2em"&gt;+m:+s&lt;/div&gt;
  &lt;script type="text/javascript"&gt;
     window.onload=new function strtWatch() {
     
    let time, intervalId;
         new function strtWatch(i) {
      time = -1;
      incrementTime();
      intervalId = setInterval(incrementTime, 1000);        
    }
   strtWatch();
  
          function incrementTime() {
              time++;
              document.getElementById("time").innerHTML =
                      ("0" + Math.trunc(time / 60)).slice(-2) +
                      ":" + ("0" + (time % 60)).slice(-2);
                 t=setTimeout('startTime()',500);
  }
  function checkTime(i)
  {
  if (i&lt;10)
  {
  i="0" + i;
  }
  
  }
  }
  
  &lt;/script&gt;</code></pre>
  </div>
  </div>
  </p>