DOM:createElement(),appendChild()和createTextNode()

createTextNode  创建的是内容 
createElement    创建的标签

http://www.cnblogs.com/gaonengquan/archive/2009/04/07/1430986.html

document.createElement()的用法
http://blog.csdn.net/rocky_j2ee/archive/2009/01/30/3855130.aspx
关于createElement("a")的几个例子:
http://www.jb51.net/article/10961.htm
<html> 
<head> 
<title>DOM Test</title> 
</head> 
<body> 
<p id="hello" style="background-color:#FFFF00"> &nbsp;</p> 
</body> 
<script> 
var text1 = document.createTextNode( "xx"); 
var text2 = document.createTextNode( "dd"); 
var oneinput = document.createElement( "input"); 
oneinput.type = "text"; 
var thep = document.getElementById( "hello"); 
thep.appendChild(text1); 
thep.appendChild(oneinput); 
thep.appendChild(text2); 
</script> 
</html> 


你可能感兴趣的:(html,.net,Blog)