Javascript examples for DOM HTML Element:Textarea
Check value length from textarea
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <script type="text/javascript"> function substitute(argument) {//from w ww .j a v a2 s . c o m var myVal=document.getElementById('myTextBox').value; if (myVal.length>0) { console.log(myVal); } if (myVal.length==0) { console.log('Empty Textbox'); } } </script> </head> <body> <input type="button" name="Button" value="Click Me" onclick="substitute();"> <textarea name="myTextBox" id="myTextBox"></textarea> </body> </html>