title: JavaScript Filling Default value back into text field on blur
body: <p>I have a problem. I want the text to be filled by the default value when user lefts it blank here is my code. Please help me to tackle this error.</p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
  &lt;title&gt;
  &lt;/title&gt;
  &lt;script lang='javascript'&gt;
  function makeBlank(obj,defMsg){
      if(obj.value==defMsg){
          obj.value="";
      }
  }
  function fillDefValue(obj,defMsg){
      if(obj.value==""){
          obj.value=defMsg;
      }
  }
  &lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;input style="width:190px" onblur="fillDefValue(this,'User Name')" onfocus="makeBlank(this,'User Name')" value="Name" name="fromname" id="fromname" type="text"&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>