title: html button element to load preformatted test to clipboard
body: <p>I want a button where:</p>
  
  <ul>
  <li><code>onmousedown</code> loads preformatted text into a textarea element, and </li>
  <li><code>onmouse</code> up saves that same preformatted text to the clipboard to be pasted into a document.</li>
  </ul>
  
  <hr>
  
  <pre><code>&lt;textarea name="REMARKSTEXTAREA" id="REMARKSTEXTAREA" rows="1" cols="100"&gt;   &lt;/textarea&gt;
  
   &lt;input value="preformatted text" 
     onmousedown="function(loadtext);"
     onmouseup="copy_to_clipboard('REMARKSTEXTAREA');" 
     type="button"&gt;
   &lt;script&gt;
   function(loadtext)
   {
     var mytextbox = document.getElementById('REMARKSTEXTAREA');
     mytextbox = "preformatted text";
   }
   function copy_to_clipboard(id)
   {
     document.getElementById('REMARKSTEXTAREA').select();
     document.execCommand('copy');
   }
   &lt;/script&gt;
  </code></pre>