标签:
1 window.onload = function() {
2 var content = document.getElementById("content");
3 var info = document.getElementById("info");
4 var btn = document.getElementById("btn");
5
6 info.onkeydown = function(ev) {
7 var oEvent = ev || event;
8
9 if (oEvent.ctrlKey && oEvent.keyCode === 13) {
10 content.value += info.value + "\n";
11 info.value = "";
12 }
13 };
14
15 btn.onclick = function() {
16 content.value += info.value + "\n";
17 info.value = "";
18 };
19 };
标签:
原文地址:http://www.cnblogs.com/HuoAA/p/5074180.html