View Full Version : javascript that adds to a text area

06-02-2006, 12:12 AM
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?

06-02-2006, 12:32 AM
Nevermind, I found a way.

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