<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>客服一网通 www.kfewt.com </title>
</head>
<body onload="test();">
<form id=form1>
<input type=text onclick= "AppendText(this) ">
<textarea id=txt name=txt onpropertychange="ScrollToBottom();" onfocus= "ScrollToBottom();" rows=9>
111111asdf ;a;fjk aldfja;df ajk;df ;aldsfja;sdf
22222 adsfads
3333fasd fasdf adfasdfasdf
444asdf
555asdf asdf adfasdfasdfasdf
666asdf adf
777adsfa
8888888 sdf asdfasdfasdf
99999a sdfasdfasdfasdf asdfasdf
0000000 asdf asdf
1
2
3
4
5
</textarea>
</form>
<script language=javascript>
function ScrollToBottom() {
document.getElementById("txt").scrollTop=document.getElementById("txt").scrollHeight;
}
ScrollToBottom();
function AppendText(t) {
document.getElementById("txt").value += "\n " + t.value ;
ScrollToBottom();
}
function test()//显示最后一行
{
document.all.txt.scrollTop=document.all.txt.scrollHeight;
}
</script>
</body>