::烟舞者::

   

------------------------------------------

-=网页设计=-

 
在TEXTAREA中显示表格以及图像
作者:半支烟  发表时间:2004-11-26

 

第一段:

<textarea name="t" rows="20" cols="50"></textarea>
<script language="JavaScript">
var oTable = document.createElement("TABLE");
var oTBody = document.createElement("TBODY");
var oTR = document.createElement("TR");
var oTD = document.createElement("TD");
oTD.innerText = '无忧脚本';
oTR.appendChild(oTD);
oTBody.appendChild(oTR);
oTable.border = 1;
oTable.appendChild(oTBody);
t.appendChild(oTable);
</script>

第二段:
<textarea id="test" rows="20" cols="50"></textarea>
<Script Language="JavaScript">
var oImg=document.createElement("IMG");
oImg.src="http://www.2yup.com/asp/images/asp_logo1.gif";
test.appendChild(oImg);
</Script>
[/color]

第三段:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>New Page 1</title>
</head>
<body>
<form name="form1">
<textarea name="t" rows="20" cols="50"></textarea>
<table id=otd border=1 cellspacing=1 width=68%><tr><td width=50%>11</td><td width=50%>12</td></tr><tr><td width=50%>21</td><td width=50%>22</td></tr></table>
<script language="JavaScript"> 
document.form1.t.appendChild(otd);
</script>
</form>
</body>
</html>

第四段:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>New Page 1</title>
</head>

<body>
<form name="form1">
<textarea name="t" rows="20" cols="50"></textarea>
<script language="JavaScript"> 
var oTable = document.createElement("TABLE");
var oTBody = document.createElement("TBODY");
var oTR = document.createElement("TR");
var oTD = document.createElement("TD");
var str='<table border=1 cellspacing=1 width=68%><tr><td width=50%>11</td><td width=50%>12</td></tr><tr><td width=50%>21</td><td width=50%>22</td></tr></table>';
var otd=document.createElement(str);
oTD.innerHTML= str;
oTR.appendChild(oTD);
oTBody.appendChild(oTR);
oTable.border = 1;
oTable.appendChild(oTBody);
form1.t.appendChild(oTable);
</script>
</form>
</body>
</html>

----------------------------------------
 

 

半支烟发表于:JS/CSS/XHTML  


 
留言内容(共有条)


{CommentAuthor}评论说:
{CommentContent}

--- {CommentTime} {CommentUrl}


 

流年--似水


也说--几句


 来来--往往


 

 快速--登陆

*用户名:
*密   码:

 


日志--搜索


踩上--几脚

 
zzj 最新的 20 条日志
 

 

 

Designed By UBABY--2005