Javascript examples for DOM HTML Element:Textarea
Setting a text to Bold in a textarea
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> </head> <body> <form name="myform"> <input type="button" onclick="Bold()" value="Bold"> </form> <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'; } </script> </body> </html>