Javascript examples for DOM HTML Element:Textarea
Handle Textarea key event and limit enter pressed
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <script type="text/javascript"> window.onload=function(){/*from ww w. j av a 2 s . c o m*/ document.getElementById("myTextArea").addEventListener("keydown", function (e) { if (e.keyCode == 13) { e.preventDefault(); } }); } </script> </head> <body> <textarea id="myTextArea">Test</textarea> </body> </html>