createTextNode 创建的是内容
createElement 创建的标签
[url]http://www.cnblogs.com/gaonengquan/archive/2009/04/07/1430986.html[/url]
document.createElement()的用法
[url]http://blog.csdn.net/rocky_j2ee/archive/2009/01/30/3855130.aspx[/url]
关于createElement("a")的几个例子:
[url]http://www.jb51.net/article/10961.htm[/url]
createElement 创建的标签
[url]http://www.cnblogs.com/gaonengquan/archive/2009/04/07/1430986.html[/url]
document.createElement()的用法
[url]http://blog.csdn.net/rocky_j2ee/archive/2009/01/30/3855130.aspx[/url]
关于createElement("a")的几个例子:
[url]http://www.jb51.net/article/10961.htm[/url]
<html>
<head>
<title>DOM Test</title>
</head>
<body>
<p id="hello" style="background-color:#FFFF00"> </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>