title: Search and replace word of textarea onclick
body: <p>I'm looking for a way to search and replace some word onclick (not all content). It's working only on predefined textarea. I want to run the script for the words I've just wrote.</p>
  
  <pre><code>&lt;form action="#"&gt;
  &lt;textarea class="input" name="input" type="text" id="txt" /&gt;test&lt;/textarea&gt;
  &lt;input type="button" value="Run" id="run"/&gt;
  &lt;/form&gt;
  
  $(document).ready(function() {
      $('#run').click(function() {
      var textarea=$('#txt'); 
      textarea.html(textarea.html().replace(/test/g,"ok")); 
      });
  });
  </code></pre>