title: Why is my javascript button click not working?
body: <p>I made a document where clicking on the <code>CLR</code> button should call the function <code>clear()</code> from the <code>calc.js</code> file and set the <code>innerHTML</code> of the cell of the table marked as "disp" to <code>80085</code>. It's not working as I had thought it to. Why is it not working? Below are my codes.</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>function clear() {
    var disp = document.getElementById('disp');
    disp.innerHTML = "80085";
  }
  
  //function number('s') {
  //  
  //}
  //the number function has yet to be implemented</code></pre>
  <pre class="snippet-code-css lang-css prettyprint-override"><code>table {
    border-collapse: collapse;
  }
  
  #display {
    background-color: lightgray;
  }
  
  button {
    width: 100%;
    background-color: white;
    border: 1px solid #008CBA;
    border-radius: 2px;
    transition-duration: 0.1s;
  }
  
  button:hover {
    background-color: #008CBA;
    color: white;
  }
  
  button:active {
    background-color: #007ea7;
    border: 1px solid #007ea7;
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  
    &lt;head&gt;
      &lt;script src="calc.js" type="text/javascript"&gt;&lt;/script&gt;
      &lt;link href="calc.css" rel="stylesheet" type="text/css" /&gt;
      &lt;meta charset="utf-8"&gt;
      &lt;title&gt;Simple Calculator&lt;/title&gt;
    &lt;/head&gt;
  
    &lt;body&gt;
      &lt;table&gt;
        &lt;tr&gt;
          &lt;td colspan="3" id="disp"&gt;0&lt;/td&gt;
          &lt;td&gt;&lt;button onclick="clear();"&gt;CLR&lt;/button&gt;&lt;/td&gt;
        &lt;/tr&gt;
  
        &lt;tr&gt;
          &lt;td&gt;&lt;button onclick="number("7");"&gt;7&lt;/button&gt;&lt;/td&gt;
          &lt;td&gt;&lt;button onclick="number("8");"&gt;8&lt;/button&gt;&lt;/td&gt;
          &lt;td&gt;&lt;button onclick="number("9");"&gt;9&lt;/button&gt;&lt;/td&gt;
          &lt;td&gt;&lt;button onclick=""&gt;/&lt;/button&gt;&lt;/td&gt;
        &lt;/tr&gt;
  
        &lt;tr&gt;
          &lt;td&gt;&lt;button onclick="number("4");"&gt;4&lt;/button&gt;&lt;/td&gt;
          &lt;td&gt;&lt;button onclick="number("5");"&gt;5&lt;/button&gt;&lt;/td&gt;
          &lt;td&gt;&lt;button onclick="number("6");"&gt;6&lt;/button&gt;&lt;/td&gt;
          &lt;td&gt;&lt;button onclick=""&gt;*&lt;/button&gt;&lt;/td&gt;
        &lt;/tr&gt;
  
        &lt;tr&gt;
          &lt;td&gt;&lt;button onclick="number("1");"&gt;1&lt;/button&gt;&lt;/td&gt;
          &lt;td&gt;&lt;button onclick="number("2");"&gt;2&lt;/button&gt;&lt;/td&gt;
          &lt;td&gt;&lt;button onclick="number("3");"&gt;3&lt;/button&gt;&lt;/td&gt;
          &lt;td&gt;&lt;button onclick=""&gt;-&lt;/button&gt;&lt;/td&gt;
        &lt;/tr&gt;
  
        &lt;tr&gt;
          &lt;td&gt;&lt;button onclick="number("7");"&gt;0&lt;/button&gt;&lt;/td&gt;
          &lt;td&gt;&lt;button onclick=""&gt;.&lt;/button&gt;&lt;/td&gt;
          &lt;td&gt;&lt;button onclick=""&gt;=&lt;/button&gt;&lt;/td&gt;
          &lt;td&gt;&lt;button onclick=""&gt;+&lt;/button&gt;&lt;/td&gt;
        &lt;/tr&gt;
      &lt;/table&gt;
    &lt;/body&gt;
  
  &lt;/html&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>All and nay hep would be appreciated!</p>