在textarea后面增加一个没那么复杂吧
试试这段代码
<html>
<head>
<script type="text/javascript">
function changeValue(name)
  {
//  alert(document.getElementById('txt1').value);
document.getElementById('txt1').value += name;
  }
</script>
</head>
<body><textarea id="txt1">
Hello world....This is a text area
</textarea>
<br />
<input type="button" onclick="changeValue('a.jpg')" 
value="Change value" /></body>
</html>