title: Javascript function not changing HTML
body: <p>I am having difficulty with this script showing the yes or no permanently. Could anyone tell me why?</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html lang="en-US"&gt;
  &lt;head&gt;
      &lt;title&gt;Project&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;h1&gt;Is it prime?&lt;/h1&gt;
  &lt;hr&gt;
  &lt;p&gt;This tool was designed to determine if a number is prime &lt;/p&gt;
  &lt;form&gt;
      &lt;input type="number" id="Number" name="enterednumber"/&gt;
      &lt;input type="submit" id="theButton" onclick="isitprime(this.form.enterednumber.value)"/&gt;
  &lt;/form&gt;
  &lt;p id="answer"&gt;&lt;/p&gt;
  &lt;/body&gt;
  &lt;script&gt;
  function isitprime(v)
  {
  var isprime=0;
  for(i=2, i&lt;v, i++)
      {
      if(v%i==0)
          isprime=1;
      }
  if(isprime==1)
      document.getElementById("answer").innerHTML="No";
  else
      document.getElementById("answer").innerHTML="Yes";
  }
  &lt;/script&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Basically I am trying to pass an entered value to my function isitprime() and then have text that says yes or no pop up. </p>