title: Total up even number from 1 to A number that user enter using JavaScript and HTML
body: <p>How can I display even number from the user input? My code does not reply anything.</p>
  <p><a href="https://i.stack.imgur.com/y6BHz.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/y6BHz.png" alt="the question" /></a></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&gt;
  
  &lt;head&gt;
    &lt;script&gt;
      var num;
      var count = 0;
      var result;
  
      num = Number(prompt("Enter the maksimum number: ", ""));
  
      document.write("Sum of all even number from 1 to " + num);
  
      for (int i = 0; i &lt; num; i += 2) {
        sum += i;
      }
  
      document.write(sum);
    &lt;/script&gt;
  &lt;/head&gt;
  
  &lt;body&gt;
  &lt;/body&gt;
  
  &lt;/html&gt;</code></pre>
  </div>
  </div>
  </p>