title: How to check the value of input
body: <p>Its app / site like brain trainer</p>
  <pre><code>  &lt;body style=&quot;text-align: center;&quot;&gt;
      &lt;h3 id=&quot;num1&quot;&gt;&lt;/h3&gt;
  
      &lt;h3 id=&quot;num2&quot;&gt;&lt;/h3&gt;
      &lt;input type=&quot;text&quot; id=&quot;ans&quot; /&gt;
      &lt;button id=&quot;myBtn&quot; onclick=&quot;clickFunction()&quot;&gt;Button&lt;/button&gt;
      &lt;p id=&quot;ind&quot;&gt;&lt;/p&gt;
      &lt;script&gt;
          var i = 0;
          var number1 = Math.floor(Math.random() * 20);
          var number2 = Math.floor(Math.random() * 20);
          var result = number1 * number2;
          document.getElementById(&quot;num1&quot;).innerHTML = number1;
          document.getElementById(&quot;num2&quot;).innerHTML = number2;
          let answer = document.getElementById(&quot;ans&quot;);
          if (result == answer) {
            document.getElementById(&quot;ind&quot;).innerHTML =
              &quot;Indicator : Right &quot; + i++ + &quot;times.&quot;;
          } else {
            document.getElementById(&quot;ind&quot;).innerHTML =
              &quot;Indicator : Right &quot; + i-- + &quot; times.&quot;;
          }
    answer.addEventListener(&quot;keyup&quot;, function(event) {
    if (event.keyCode === 13) {
     event.preventDefault();
     document.getElementById(&quot;myBtn&quot;).click();
    }
  });
      &lt;/script&gt;
  </code></pre>
  <p>I need to add a button which should submit the text in input</p>
  <p>And i want to check if it met the condition, if it does, the counter should be increasing</p>