做好提交内容框后怎么在此基础上做清空文本框内容
<script>
window.onload = function() {
var oTxt1 = document.getElementById('txt1');
var oTxt2 = document.getElementById('txt2');
var oBtn = document.getElementById('btn1');
oBtn.onclick= function() {
oTxt1.value += oTxt2.value + '\n';
oTxt2.value = '';
}
oTxt2.onkeydown= function(ev) {
var oEvent = ev || event;
//ctrlKey,shiftKey,altKey。
//其它按键用keyCode==*表示!
if(oEvent.ctrlKey&&oEvent.keyCode = =13 ) {
oTxt1.value += oTxt2.value+'\n';
oTxt2.value = '';
}
}
}
</script>
</head>
<body>
<textarea id="txt1" rows="10" cols="40"></textarea><br />
<input type="text" id="txt2" />
<input type="button" id="btn1" value="留言" />
</body>