title: Display answer of 'Add and Subtract' buttons using javascript
body: <p>So I am trying to practice javascript and so I'm trying to do a small javascript code in which a random number is generated whenver the page loads and then the user has the option of subtracting or adding 10 from that number. The user can also input any text in the textfield and the text there will be displayed with the answer. For ex: if the random number generated is 100 and the user choose the 'subtract 10' option and wrote 'Hello' in the text field, the output will be '90Hello'.
  I did most of the code, but I can't figure out how to display the answer because it doesn't work for some reason. The random number is shown but the add and subtract buttons are not working. Can someone help with that?</p>
  <p>The code till now is:</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>count = 0;
  
  let y = Math.floor(Math.random() * 100) + 1;
  y = document.getElementById("numb").innerHTML;
  
  function subtractTen() {
    var t1 = document.getElementById("te");
    var n1 = document.getElementById("numb") * 10;
    var subtract = Number(n1.value);
    var ans = subtract + t1;
    var answerSpan = document.getElementById("answer");
    answerSpan.innerHTML = out;
  }
  
  function addTen() {
    var t2 = document.getElementById("te");
    var n2 = document.getElementById("numb") / 10;
    var add = Number(n2.value);
    var ans = add + t2;
    var answerSpan = document.getElementById("answer");
    answerSpan.innerHTML = out;
  }
  
  function reset() {
    count = countN * 0;
    var res = document.getElementById("numb");
    res.innerHTML = count;
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;html&gt;
  &lt;head&gt;
    &lt;title&gt;&lt;/title&gt;
  &lt;/head&gt;
  
  &lt;body&gt;
    &lt;h1&gt; Add Subtract&lt;/h1&gt;
  
    &lt;button onClick="subtractTen();" value="sub" /&gt; Subtract 10 &lt;/button&gt;
    &lt;button onClick="addTen();" value="add" /&gt; Add 10 &lt;/button&gt;
    &lt;button onClick="reset();" value="res" /&gt; Reset &lt;/button&gt;
    &lt;br /&gt;
    &lt;input name="text" id="te" /&gt;
    &lt;span id="numb" id="answer"&gt;&lt;/span&gt;
  
  &lt;/body&gt;
  
  &lt;/html&gt;</code></pre>
  </div>
  </div>
  </p>