title: The UWP JS app I am making with Visual Studio 2017 will not print numbers generated by JavaScript. Is there a reason or workaround to this?
body: <p>My UWP JS app in Visual Studio 2017 will accept my JavaScript code that is supposed to generate numbers and print in the html field that is provided, but when I test it nothing happens. Is there a reason why this is happening? If so can someone help me find a workaround?
  Here is the HTML and JavaScript code:</p>
  
  <pre class="lang-js prettyprint-override"><code>function displaySuccess() {
    // console.log('yeah');
    displayTask();
  }
  
  function displayFailure() {
    // console.log('nope')
  }
  
  function displayTask() {
    var a = Math.random() * 25,
      b = Math.random() * 25;
    var c = parseInt(a) * parseInt(b);
  
    var inputA = document.getElementById("a");
    inputA.setAttribute("value", parseInt(a));
    var inputB = document.getElementById("b");
    inputB.setAttribute("value", parseInt(b));
  
    var inputC = document.querySelector("useranswer");
    inputC.setAttribute("value", "");
    inputC.onchange = function(evt) {
      var elem = evt.target;
      try {
        var result = parseInt(elem.value);
        if (result == c) {
          displaySuccess();
        } else {
          displayFailure();
        }
      } catch (e) {}
    };
  }
  window.onload = function() {
    displayTask();
  }
  </code></pre>
  
  <pre class="lang-html prettyprint-override"><code>&lt;form method='post'&gt;
    &lt;input type='hidden' name='a' value={{a}} /&gt;
    &lt;input type='hidden' name='b' value={{b}} /&gt;
    &lt;input type='hidden' name='calcanswer' value={{calcanswer}} /&gt;
    &lt;h3&gt;Solve the multiplication: &amp;nbsp;&amp;nbsp; &lt;input type=text name=a size=3 id="a"&gt; x &lt;input type=text name=b size=3 value={{b}}&gt; = &lt;input type='text' name='useranswer' value='{{useranswer}}' size='2' /&gt;&lt;/h3&gt;
    &lt;input type='submit' value='Answer' /&gt;
  &lt;/form&gt;
  </code></pre>