Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Jun 2006
    Posts
    54
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Arrow javascript that adds to a text area

    Okay, I have a problem that should be simple. What is the javascript that adds the contents of a string to a text area? Even better, is there html to do that?

  • #2
    New Coder
    Join Date
    Jun 2006
    Posts
    54
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Lightbulb

    Nevermind, I found a way.

    Code:
    <html>
       <script language="javascript">
       <!--
       function addtotextarea(what) {
       	document.form.test.value = document.form.test.value + what
       }
       // -->
       </script>
       <body>
          <form name="form">
             <textarea name="test"></textarea>
          </form>
          <button onclick="addtotextarea('hi');">Hi</button>
       </body>
    </html>


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •