title: Displaying a Message
body: <p>I am working on a new security assessment webpage in which I am using HTML and Java Script. For some reason, the code is not working properly. The way the page supposed to work is by having the user answer Yes or No questions, and when the user is done they click submit. Then the page would display the number of questions answered yes, and a message if the user passed or failed the assessment. But when I click submit, I only see the result, not the message. </p>
  
  <p>Any feedback would be appreciated. </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 sumInputs() {
    var text;
    var score = document.getElementById("total").value;
  
    if (score &lt; 60) {
      text = "You have failed the Assessment";
    } else(score &gt; 60) {
      text = "You have passed the Assessment";
    }
  
    document.getElementById("demo").innerHTML = text;
  }
  
  function calcscore() {
    var score = 0;
    $(".calc:checked").each(function() {
      score += parseInt($(this).val(), 10);
    });
    $("input[name=sum]").val(score)
  }
  
  $().ready(function() {
    $(".calc").change(function() {
      calcscore()
  
    });
  });
  
  window.sumInputs = function() {
    var inputs = $('.calc:checked'),
      result = document.getElementById('total'),
      sum = 0;
  
    for (var i = 0; i &lt; inputs.length; i++) {
      sum += parseInt(inputs[i].value);
    }
  
    $('#total').val(sum);
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"&gt;&lt;/script&gt;
  &lt;html&gt;
  
  &lt;body&gt;
    &lt;p id="demo"&gt;&lt;/p&gt;
    &lt;h1&gt;Security Assessment &lt;/h1&gt;
  
    &lt;table&gt;
      &lt;tr&gt;
        &lt;th&gt;PERSONNEL SECURITY&lt;/th&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;td&gt;1. Does your staff wear ID badges?
          &lt;form&gt;
            Yes
            &lt;input class="calc" type="radio" name="radio1" value="1" /&gt; No
            &lt;input class="calc" type="radio" name="radio1" value="0" /&gt;&lt;br /&gt;
        &lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;td&gt;2. Is a current picture part of the ID badge? Yes
          &lt;input class="calc" type="radio" name="radio2" value="1" /&gt; No
          &lt;input class="calc" type="radio" name="radio2" value="0" /&gt;&lt;br /&gt;
        &lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;td&gt;3. Are authorized access levels and type (employee, contractor, visitor) identified on the Badge? Yes
          &lt;input class="calc" type="radio" name="radio3" value="1" /&gt; No
          &lt;input class="calc" type="radio" name="radio3" value="0" /&gt;&lt;br /&gt;
          &lt;/form&gt;
        &lt;/td&gt;
      &lt;/tr&gt;
    &lt;/table&gt;
  
    Total : &lt;input type="text" name="total" id="total" /&gt;
  
    &lt;input type="Submit" value="Submit" onclick="sumInputs()"&gt;
  &lt;/body&gt;
  &lt;/html&gt;</code></pre>
  </div>
  </div>
  </p>