title: HTML input onfocus & onblur?
body: <p>ok, today I'm making a helper HTML function. It looks like this:</p>
  
  <pre><code>function Input($name,$type,$lable,$value= null){
    if (isset($value)) {
      //if (this.value=='search') this.value = ''
      echo '&lt;label for="'. $name .'"&gt;'. $lable .'&lt;/label&gt;&lt;input type="'.$type.'" name="'. $name .'" id="'. $name .'" value="'.$value.'" onfocus="if (this.value==\''.$value.'\') this.value = \'\' "/&gt;';  
    }
    if (!isset($value)) {
      echo '&lt;label for="'. $name .'"&gt;'. $lable .'&lt;/label&gt;&lt;input type="'.$type.'" name="'. $name .'" id="'. $name .'" /&gt;'; 
    }
  }
  </code></pre>
  
  <p>As you can see, if you insert a value it will do some JavaScript so that when I click the box, the text inside the box will disappear,</p>
  
  <p><strong>Question:</strong> How can we make it to have a value when we are not on the input? (please look at the search box on stackoverflow, however the one that is on stackoverflow doesn't come back after we are not pointing at the input box? Maybe by using onblur? Am I right?</p>
  
  <p>Hope you understand what I mean.</p>
  
  <p>ok becouse some of you are not getting what i mean
  please see</p>
  
  <blockquote>
    <p>when im not clicking it.</p>
  </blockquote>
  
  <p><a href="https://i.stack.imgur.com/keRq0.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/keRq0.png" alt="alt text"></a>
  </p>
  
  <blockquote>
    <p>when im clicking it.</p>
  </blockquote>
  
  <p><a href="https://i.stack.imgur.com/ZkFWr.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ZkFWr.png" alt="alt text"></a>
  </p>
  
  <blockquote>
    <p>when im not clicking it again.</p>
  </blockquote>
  
  <p><a href="https://i.stack.imgur.com/ZkFWr.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ZkFWr.png" alt="alt text"></a></p>
  
  <p><strong>it should be</strong></p>
  
  <blockquote>
    <p>when im not clicking it.</p>
  </blockquote>
  
  <p><a href="https://i.stack.imgur.com/keRq0.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/keRq0.png" alt="alt text"></a></p>
  
  <blockquote>
    <p>when im clicking it.</p>
  </blockquote>
  
  <p><a href="https://i.stack.imgur.com/ZkFWr.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ZkFWr.png" alt="alt text"></a></p>
  
  <blockquote>
    <p>when im not clicking it again.</p>
  </blockquote>
  
  <p><a href="https://i.stack.imgur.com/keRq0.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/keRq0.png" alt="alt text"></a></p>