編寫壹個html的表單,有幾個文本框,幾個按鈕,壹個文本域,能將文本框裏的內容按按鈕後添加到文本域中
<html>
<head>
<script >
function addInfo()
{
var textinfo = document.forminfo.textinfo.value;
document.forminfo.areainfo.value = textinfo;
document.forminfo.textinfo.value = "";
}
function clearInfo()
{
document.forminfo.textinfo.value = "";
document.forminfo.areainfo.value = "";
}
</script>
<title>
</title>
</head>
<body>
<form name="forminfo" action="">
<div align="center">
<textarea name="areainfo" cols="40" rows="10" ></textarea>
</div>
<div align="center">
<input type="text" name="textinfo" style="width:300px">
</div>
<div align="center">
<input type="button" value="確定" onclick="addInfo()">
<input type="button" value="取消" onclick="clearInfo()">
</div>
</form>
</body>
</html>