title: clear inner html of span using jquery
body: <p>I am using below code to compare pass and confirm password text field. Its working fine but the issue is if enter mismatch password its showing error ' password do not match' and after that if i match the password its showing 'password match' next to old error. so its displaying like 'password do not match password match'(please see the image for reference.. <a href="http://i.imgur.com/NBR7z.jpg" rel="nofollow"><strong><em>Error Image</em></strong></a></p>
  
  <p>. How to clear the span before i show the message.</p>
  
  <pre><code>   $(confPassword).live('blur', function() {
      alert(password.value);
      if (password.value != 'Password') {
          alert("hi");
          if (password.value == confPassword.value) {
              alert("match");
              setupConfirmControl(confPassword, astConfPassword, lblConfPassword, true);
          }
          else {
              alert("dont match");
              setupConfirmControl(confPassword, astConfPassword, lblConfPassword, false);
          }
      }
  });
  
  function setupConfirmControl(elemObj, id, labelTxt, addToParent) {
      var ConfirmPass = document.createElement('span');
      ConfirmPass.setAttribute('class', 'ClsConfirmPass');
      ConfirmPass.setAttribute('id', 'span' + id);
      ConfirmPass.innerHTML = '';
      if (addToParent) {
          ConfirmPass.innerHTML = 'Passwords match';
          elemObj.parentNode.insertBefore(ConfirmPass, elemObj);
      }
      else {
          ConfirmPass.innerHTML = 'Passwords do not match';
          elemObj.parentNode.insertBefore(ConfirmPass, elemObj);
      }
      showConfirmPassWord(id);
  }
  </code></pre>