title: OnClick function starting at opening page
body: <p>This may sound stupid but i wrote some code to convert binary into a normal number. I have a button that you have to press which runs the entire function. However, without clicking the button the function launched.</p>
  <pre><code>let button = document.getElementById(&quot;submit&quot;);
  let binary;
  let result = document.createElement(&quot;h1&quot;);
  result.className = &quot;answer&quot;;
  
  button.addEventListener(&quot;click&quot;, calc());
  
  
  function calc(){
      binary = document.getElementById(&quot;binary&quot;).value;
      result.textContent = &quot;The Result is: &quot; + parseInt(binary, 2);
      document.body.appendChild(result);
      console.log('here');
  }
  
  </code></pre>
  <p>When i load the page the 'The result is' text is already there and when i do click it it wont console log or change the value.
  This may be stupid but i cant figure it out
  thanks in advance.</p>