<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
<style type="text/css">
#divQQ {
width: 500px;
height: 350px;
border: 2px dotted #000000;
padding: 10px;
/*background-color:gray;*/
}
</style>
<script type="text/javascript">
window.onload = function () {
var divqq = document.getElementById(‘divQQ‘);
var spanke = document.getElementById(‘kefu‘);
var txtinput = document.getElementById(‘txt‘);
var btn = document.getElementById(‘btnSender‘);
//表单的innerHTML为获取该表单内所有内容
btn.onclick = function () {
divqq.innerHTML = divqq.innerHTML + spanke.innerHTML + txtinput.value + "<br/>";
txtinput.value = ‘‘;
}
}
</script>
</head>
<body>
<div id="divQQ"> </div>
<span id="kefu">江中客服:</span>
<input type="text" id="txt" />
<input type="button" value="发送" id="btnSender" />
</body>
</html>