window.onload = function (){
var opinput = document.createElement( ' textarea ' );
opinput.setAttribute( ' id ' , ' aa ' );
var a = document.getElementById( ' a ' );
a.appendChild(opinput);
var i = document.getElementById( ' aa ' );
i.innerHTML = ' ddd ' ;
}
< div id ="a" ></ div >
本文转自豪情博客园博客,原文链接:http://www.cnblogs.com/jikey/archive/2009/12/10/1621302.html,如需转载请自行联系原作者