这个DIV怎么用JS的innerHTML无法添加上多行呢??给个解决方法 50分
function IMG3_onclick()
{
document.all.chateacher.innerHTML +=document.all.chateacher.innerHTML + document.all.chatmes.value + " <br> ";
}
用上边的函数可以添加但是显示不了多行
奇怪的是 如果默认的下边DIV中有10行内容的话 把他清空 就可以添加10的显示行
再继续添加又不行了
我想要带右边拖动的这个DIV又想可以用JS添加无限行显示的 请高手指教
<div id= "chateacher " style= "word-break:break-all;background-color:White;width: 370px; height: 190px; OVERFLOW-Y: auto;
overflow:no;
LINE-HEIGHT: 100%;
SCROLLBAR-FACE-COLOR: #e4ecf7;
SCROLLBAR-HIGHLIGHT-COLOR: #e6edf7;
SCROLLBAR-SHADOW-COLOR: #e6edf7;
SCROLLBAR-3DLIGHT-COLOR: #e6edf7;
SCROLLBAR-ARROW-COLOR: #b7cbe3;
SCROLLBAR-TRACK-COLOR: #ffffff;
SCROLLBAR-DARKSHADOW-COLOR: #gggggg;
padding:2px 8px 8px 8px;
background-repeat: no-repeat " name= "chateacher ">
</div>
------解决方案--------------------没有任何问题
<div id= "chateacher " style= "word-break:break-all;background-color:White;width: 370px; height: 190px; OVERFLOW-Y:
auto;
overflow:no;
LINE-HEIGHT: 100%;
SCROLLBAR-FACE-COLOR: #e4ecf7;
SCROLLBAR-HIGHLIGHT-COLOR: #e6edf7;
SCROLLBAR-SHADOW-COLOR: #e6edf7;
SCROLLBAR-3DLIGHT-COLOR: #e6edf7;
SCROLLBAR-ARROW-COLOR: #b7cbe3;
SCROLLBAR-TRACK-COLOR: #ffffff;
SCROLLBAR-DARKSHADOW-COLOR: #gggggg;
padding:2px 8px 8px 8px;
background-repeat: no-repeat " name= "chateacher ">
</div>
<input type=button onclick= "x() ">
<script>
function x()
{
document.all.chateacher.innerHTML +=document.all.chateacher.innerHTML + "test " + " <br/> ";
}
</script>