title: Can't press the button on html page log errors "Uncaught TypeError: Cannot read property 'addEventListener' of null"
body: <p>I tried to learn some basic of different about JS and TS but when I code basic HTML and JS for plus 2 number (first of all I didn't expect it can add for Ex. 10 + 2 = 12 I just expect 102).
  But when I opened my html file for test my script console thrown this error</p>
  <blockquote>
  <p>Uncaught TypeError: Cannot read property 'addEventListener' of null</p>
  </blockquote>
  <p>So, I can't press add button too here my HTML code</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-js lang-js prettyprint-override"><code>const button = document.querySelector("button1");
  const input1 = document.getElementById("input1");
  const input2 = document.getElementById("input2");
  
  function add(num1, num2) {
      if ( typeof num1 === "number" &amp;&amp; typeof num2 === "number") {
          return num1 + num2;
  
      } else {
          return +num1 + +num2;
      }
  }
  
  button.addEventListener("click", function() {
      console.log(add(input1.value, input2.value));
  });</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;!DOCTYPE html&gt;
  &lt;html lang="en"&gt;
  &lt;head&gt;
      &lt;meta charset="UTF-8"&gt;
      &lt;meta http-equiv="X-UA-Compatible" content="IE=edge"&gt;
      &lt;meta name="viewport" content="width=device-width, initial-scale=1.0"&gt;
      &lt;title&gt;Understanding Typescript&lt;/title&gt;
      &lt;script src="js-only.js" defer&gt;&lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
      &lt;input type="number" id="num1" placeholder="number1"&gt;
      &lt;input type="number" id="num2" placeholder="number2"&gt;
      &lt;button&gt;Add!&lt;/button&gt;
  &lt;/body&gt;
  &lt;/html&gt;</code></pre>
  </div>
  </div>
  </p>
  <p>Can you tell me what are my mistakes?</p>