title: jQuery clear input, textarea text on focus from dynamically added inputs
body: <p>I have jQuery script:</p>
  
  <pre><code>$("input:not(':input[type=button], :input[type=submit], :input[type=reset]'), textarea").each(function () {
  
  var Input = $(this);
  var default_value = Input.val();
  
  $(Input).on("focus", function() {
      if(Input.val() == default_value) Input.val("");
  }).on("blur", function() {
      if(Input.val().length == 0) Input.val(default_value);
  });
  
  });
  </code></pre>
  
  <p>Its working fine if inputs already on html, but how to make this work on dynamically added inputs?</p>
  
  <p>First idea was to change:</p>
  
  <pre><code>$(Input).on("focus", function()
  </code></pre>
  
  <p>to</p>
  
  <pre><code>$(document).on("focus", Input, function()
  </code></pre>
  
  <p>but with no luck.</p>
  
  <p>UPDATE</p>
  
  <p>I think I found way to make it work properly on any inputs:</p>
  
  <pre><code>$(document).on("focus", "input:not(':input[type=button], :input[type=submit], :input[type=reset]'), textarea", function(e) {
  if (e.target.value == e.target.defaultValue) {
      e.target.value = "";
  }
  }).on("blur", "input:not(':input[type=button], :input[type=submit], :input[type=reset]'), textarea", function(e) {
  if (e.target.value == "") {
      e.target.value = e.target.defaultValue;
  }
  });
  </code></pre>