Javascript examples for DOM HTML Element:Textarea
Make an editable textarea readonly using javascript function
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <script type="text/javascript"> window.onload=function(){//from w w w .ja v a 2 s . c o m function readOnlyTextArea(idTextArea){ document.getElementById(idTextArea).readOnly = "true"; }; readOnlyTextArea('my-box'); } </script> </head> <body> <textarea name="" id="my-box" cols="30" rows="10"></textarea> <textarea name="" id="my-box-1" cols="30" rows="10">editable</textarea> </body> </html>