[CODE]<script>
function wfsr(){
em=document.createElement("IMG");
em.src="
http://bbs.bc-cn.net/bbs/aaa/asplogo1.gif"
test.appendChild(em);
}
function wfsr2(){
em=document.createElement("A");
em.innerText="bccn";
em.href="
http://asp.bc-cn.net";
test.appendChild(em);
}
</script>
<button onclick=wfsr()>inertImg</button><button onclick=wfsr2()>inertLink</button>
<textarea id=test style="width:100%;height:300"></textarea>
<textarea id="ta" onclick="appendme()">click me</textarea>
<SCRIPT LANGUAGE="JavaScript">
<!--
function appendme(){
ta.innerText="";
img = document.createElement("IMG");
divn=document.createElement("div");
divn.innerHTML="<font style=color:red; >红色字</font>";
//fnt.style.color="red";
img.src="
http://bbs.bc-cn.net/bbs/Skins/Default/emot/em01.gif";
ta.appendChild(img);
ta.appendChild(divn);
}
//-->
</SCRIPT>[/CODE]
因该跟文本框里放图片的原理差不多吧?
[此贴子已经被作者于2006-3-31 23:29:22编辑过]