晕,LZ 之前的两贴还没结,怎么又问上了~~~
http://community.csdn.net/Expert/topic/5493/5493893.xml?temp=.1897547
http://community.csdn.net/Expert/topic/5494/5494294.xml?temp=.7225俗话说“举一反三”,可是 LZ 却“接二连三”这回要考虑考虑是否继续回答了?!!
http://community.csdn.net/Expert/topic/5493/5493893.xml?temp=.1897547
http://community.csdn.net/Expert/topic/5494/5494294.xml?temp=.7225俗话说“举一反三”,可是 LZ 却“接二连三”这回要考虑考虑是否继续回答了?!!
在问题列表中找到自己问题所在行,点击右侧的“管理”,然后给分,输入密码,点击结贴。 <body>
<textarea id="ttaOne" rows="5" cols="30"></textarea>
<textarea id="ttaTwo" rows="5" cols="30"></textarea>
<script language="JavaScript">
<!--
var eOne = document.getElementById("ttaOne");
var eTwo = document.getElementById("ttaTwo");
var strContent = "1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15"
eOne.value = strContent;
eTwo.value = strContent;eOne.onscroll = function() {
eTwo.scrollTop = eOne.scrollTop;
};eOne.onkeypress = function() {
if (event.keyCode == 13)
{
eTwo.value += "\n";
}
};eOne.onkeyup = function() {
if (event.keyCode == 8)
{
var strDelimiter = "\r\n";
var arrOreRows = eOne.value.split(strDelimiter);
var arrTwoRows = eTwo.value.split(strDelimiter);
if (arrOreRows.length < arrTwoRows.length)
{
arrTwoRows.pop();
eTwo.value = arrTwoRows.join(strDelimiter);
}
}
};
//-->
</script>
</body>