日期:2014-05-16 浏览次数:20468 次
<button onclick="window.open('t.html','','width=800,height=500')">页面</button>
<textarea id="myTextArea" cols="70" rows="20" name="content">网</textarea>
<script>
var alink=document.createElement("a");
alink.href="www.baidu.com";
alink.innerText="百度";
var oTable = document.createElement("table");
var oTBody = document.createElement("tbody");
var oTR = document.createElement("tr");
var oTD = document.createElement("td");
oTD.appendChild(alink);
oTR.appendChild(oTD);
oTBody.appendChild(oTR);
oTable.appendChild(oTBody);
window.opener.document.getElementById("myTextArea").appendChild(oTable);
</script>
var html = '<table><tbody><tr><td><a href="http://www.google.com/">GOOGLE</a></td></tr></tbody></table>';
window.opener.document.getElementById("myTextArea").value = html;