title: div text to input value
body: <p>Scenario :
  After double quote,next characters were not displaying.</p>
  
  <p>I know this is because of escaping of single and double quotes, I have tried this regex <code>(/"/g,'\"')</code>, but its not working.</p>
  
  <p>Can someone help me review the code?My wanted output is that all characters on div should also display on input.</p>
  
  <p>PS: I want to avoid <code>replace(/"/g,'&amp;quot;')</code> as much as possible.</p>
  
  <pre><code> &lt;div&gt;single ' double " single ' &lt;/div&gt;
  
  &lt;form&gt;
  &lt;/form&gt;    
  
  $("form").append('&lt;input type="text" value = "' + $("div").text().replace(/"/g,'\"') + '" /&gt;');
  </code></pre>
  
  <p>see this Fiddle <a href="http://jsfiddle.net/3uc4fLeh/3/" rel="nofollow">demo</a></p>