title: Add <b></b> tags to selected text in a textarea
body: <p>How  to create some javascript to do the following - when the user clicks the "BOLD" button, the selected text gets a "&lt;b&gt; " and a " &lt;/b&gt;" wrapped around it. </p>
  
  <pre><code> &lt;form name="my"&gt;
  &lt;textarea name="textarea"&gt;&lt;/textarea&gt;&lt;br /&gt;
  &lt;input type="button" value="bold" onclick="formatText ('b');" /&gt;
  &lt;input type="button" value="italic" onclick="formatText ('i');" /&gt;
  &lt;input type="button" value="underline" onclick="formatText ('u');" /&gt;
  &lt;/form&gt; 
  </code></pre>
  
  <p>please help me to create java-script for supporting almost web browser</p>