写了个小例子,在Firefox下可以实现如图下效果,但是在IE下无法实现如图下效果,求高手解答代码如下:
<!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=UTF-8">
<title>Insert title here</title>
<script>
  function aa() {
    var val = "adfas" + "\r\n";
val += "eeee" + "\r\n";
getValue($("con"), val);
  };  function getValue(obj, value) {
if(document.all) {
  obj.innerText += value;
} else {
  obj.textContent += value;
}
  };  function $(id) {
return document.getElementById(id);
  };
</script>
</head>
<body>
  <textarea id="con" rows=20 cols=30 ></textarea>
  <input type="button" id="btn" value="点击" onclick="aa()">
</body>
</html>