title: How can I make a table in a cell a variable?
body: <p>I have a table in a cell that displays the numbers a user enters with buttons (using onclick and a showthis function. I need to be able to store the value as a variable in order to perform operations on it. How can I do this?<br>
   PS: I am using JavaScript and HTML</p>
  
  <pre><code>&lt;script language="JavaScript" type="text/javascript"&gt; 
      function showthis(first){ 
          document.getElementById("displaycell").innerHTML+=first; 
      } 
  &lt;/script&gt;
  &lt;body&gt; 
    &lt;h1 align="center"&gt; RPN Calculator &lt;/h1&gt;
    &lt;table summary align="center" border="1" cellpadding="1" cellspacing="3"&gt;
      &lt;tr&gt;
        &lt;th id="displaycell" colspan="5" type="text"&gt; &lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;td&gt;
          &lt;button type="button" onclick="showthis('1')"&gt;1&lt;/button&gt;
        &lt;/td&gt;
        &lt;td&gt;
          &lt;button type="button" onclick="showthis('2')"&gt;2&lt;/button&gt;
        &lt;/td&gt;
        &lt;td&gt;
          &lt;button type="button" onclick="showthis('3')"&gt;3&lt;/button&gt;
       &lt;/td&gt;
       &lt;!-- ... --&gt;
  </code></pre>