Write Text in a TextArea

/ Published in: JavaScript
Save to your folder(s)

Copy this code and paste it in your HTML
  1. <head>
  2. <script language="javascript" type="text/javascript">
  3. function addtext(text) {document.form.textarea.value = document.form.textarea.value+= text;}
  4. </script>
  5. </head>
  7. <body>
  8. <form action="" method="" name="form">
  9. <textarea name="textarea" rows="" cols="" wrap="wrap"></textarea>
  10. </form>
  11. <a href="javascript:addtext('Text to add');">Add text</a>
  12. </body>

Report this snippet


RSS Icon Subscribe to comments

You need to login to post a comment.