title: onclick select whole text textarea
body: <p>iam not understanding how to copy to clickboard as soon as I click on a textarea..I mean it should select all content inside it and then it should  pop and and ask something like 'press ctrl c' to copy into clipboard.. </p>
  
  <p>I already have a code BUT unable to select full text in text area and should copy into clipboard..      </p>
  
  <pre><code> &lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"&gt;
  &lt;html&gt;
   &lt;head&gt;
   &lt;script type="text/javascript"&gt;
  
  function myfunc2() {
   var selectedobj=document.getElementById('showthis');
  
    if(selectedobj.className=='hide'){  //check if classname is hide 
      selectedobj.style.display = "block";
      selectedobj.readOnly=true;
      selectedobj.className ='show';
    }else{
      selectedobj.style.display = "none";
      selectedobj.className ='hide';
   }
  }
  
  
  function copyToClipboard (text) {
    window.prompt ("Copy to clipboard: Ctrl+C, Enter", text);
  }
  
  
  
  function select_all()
  {
  // alert(document.getElementById("showthis").value);
  
  var text_val=eval("document.getElementById('showthis').value");
  text_val.focus();
  
  var copy = text_val.select();
  window.prompt ("Copy to clipboard: Ctrl+C, Enter", copy);
  
  }
  
  &lt;/script&gt;
   &lt;/head&gt;
  
   &lt;body&gt;
  
  
              &lt;label  onclick="myfunc2()"&gt;Click here&lt;/label&gt;
              &lt;textarea id="showthis" style="display:none" class="hide"  onclick="select_all()" readonly&gt;dfdsfsfasdfdsfsfasdfssdfsfasf&lt;/textarea&gt;
  
  
   &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p><br/></p>
  
  <p>could anyone pls look into this...</p>
  
  <p><strong>EDITED:</strong>
  I need only Javascript code (not JQuery)</p>