title: I want to check answer and display it on HTML page with Javascript
body: <p>I am pretty new on Javascript coding. I'm creating a web page for surveys or testing by myself. </p>
  
  <p>Now here is my code;</p>
  
  <pre><code>&lt;form id="q1form"&gt;
  &lt;input type="radio" name="question1" value="1" id="q1"&gt; true
  &lt;input type="radio" name="question1" value="0" id="q2"&gt; false
  &lt;/form&gt;
  &lt;button onclick="myFunction()"&gt; try &lt;/button&gt;
  
  function myFunction(){
     var form = document.getElementById('q1form'),
     s1 = form['question1'],
      n;
      for (n = 0; n &lt; s1.length; n++) {
      if (s1[n].checked) {
          var soru1= parseInt(s1[n].value);
         }
  }
  if(soru1==1){ 
      document.writeln("Your answer is correct!"); 
  }
  else{
      document.wirteln("Your answer is not correct");
  }
  }
  </code></pre>
  
  <p>In this code I want to display "Your answer is correct!" or other answer near the 'try' button. I can display answer with window.alert but I want to do it near button, in same page. Is it possible? How can I do it?</p>