Setting a text to Bold in a textarea - Javascript DOM HTML Element

Javascript examples for DOM HTML Element:Textarea


Setting a text to Bold in a textarea

Demo Code

ResultView the demo in separate window

      <meta name="viewport" content="width=device-width, initial-scale=1"> 
      <form name="myform"> 
         <input type="button" onclick="Bold()" value="Bold"> 
      <textarea name="myTextArea" id="myTextArea" cols="100" rows="14" placeholder="Enter Text Here ..."></textarea> 
      <script type="text/javascript">
function Bold() {/* ww  w .ja  v a 2  s .  co  m*/
    document.getElementById("myTextArea").style.fontWeight = 'bold';


Related Tutorials