title: Document.write clears page
body: <p>Why in the code below upon the call of <code>document.write</code> in the function <code>validator()</code> the form elements (the checkbox and button) are removed from screen?</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
      &lt;head&gt;
          &lt;script type="text/javascript"&gt;
              function validator() {
                  if (document.myForm.thebox.checked)
                      document.write("checkBox is checked");
                  else 
                      document.write("checkBox is NOT checked");
              }
          &lt;/script&gt;
      &lt;/head&gt;
      &lt;body&gt;
          &lt;form name="myForm"&gt;
              &lt;input type="checkbox" name ="thebox"/&gt;
              &lt;input type="button" onClick="validator()" name="validation" value="Press me for validation"/&gt;
          &lt;/form&gt;
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>