View Full Version : javascript that adds to a text area

06-01-2006, 11:12 PM
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-01-2006, 11:32 PM
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>