title: how can you create multiple on focus and onblur?
body: <p>I want to know how to create multiple <code>onfocus</code> and <code>onblur</code> for multiple input fields.</p>
  
  <p>I have something like this but when the name field is <code>onfocus</code>, the email field is <code>onfocus</code> too. Is there a way to solve this? </p>
  
  <pre><code>$(document).ready(function(){
       focusBlur();
  });
  
  
  function focusBlur() {
  
      var formName = document.getElementById('name');
      var valueName = 'name';
  
      var formEmail = document.getElementById('email');
      var valueEmail = 'email';
  
      formName.onfocus = function() {
          if(formName.value == valueName) {
              formName.value = '';
          } 
  
          if(formEmail.value == valueEmail) {
              formEmail.value = '';
          }
      };
  
  
      formName.onblur = function() {
          if(formName.value == '') {
              formName.value = valueName;
          }
  
          if(formEmail.value == '') {
              formEmail.value = valueEmail;
          }
      };
  
  
  }
  </code></pre>