title: Clear out an error message instead of appending with javascript
body: <p>In this HTML form that I have I would like to warn the user that he has to enter a level in the inputbox, if he clicks the button again I would like to clear off the error message and print it out again. I would like to also add more error messages but anything that I add as an error message appends to the end of the previous message. 
  <div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>function validateForm () {
      var msg = ""
        , result = true;
  
      if (document.ExamEntry.name.value === "") {
          msg = document.createTextNode("You Must Indicate Your Level");
          document.getElementById('name-msg').appendChild(msg);
          document.getElementById('name-msg').style.color="red";
      }
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;form name="ExamEntry" method="POST"&gt;
      &lt;input type="text" id="name" name="name"&gt;
      &lt;span id="name-msg"&gt;&lt;/span&gt;
      &lt;input type="button" name="submit" value="Submit" onclick="validateForm();"&gt;
  &lt;/form&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>here's a <a href="http://jsbin.com/dikikoxori/1/edit?html,js,output" rel="nofollow">jsbin</a></p>