maksimerohin
6/4/2019 - 1:33 PM

Exp

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
</head>
<body>
  <h1>Hello!</h1>
  <script src="main.js"></script>
</body>
</html>
console.log("Hello!");

var i = 0;
var timer = setInterval(function() {
  console.log(i++);
}, 200);
 
window.onclick = function() {
  clearInterval(timer);
}