我正在尝试使用 javascript 将段落的值添加到文本区域。这是我目前的代码。我似乎无法让它工作。任何帮助表示赞赏
<html>
<head>
</head>
<body>
<button value="this is a length definition" onclick="reveal(this.value)"> hi</button>
<script type="text/javascript">
function reveal(value)
{
var text = value;
document.outputtext.value += value;
}
</script>
<table>
<tr>
<td><textarea name="outputtext"></textarea></td>
</tr></table>
</body>
</html>