代码改变世界

JavaScript实现动态添加Html控件

2009-10-17 15:51  floweriness  阅读(303)  评论(0编辑  收藏  举报
function Dom()
        {
            var textControl=document.createElement("input");
            textControl.setAttribute("type","text");
            textControl.setAttribute("name","txtDom");
            textControl.setAttribute("runat","server");
            document.getElementById("Show").appendChild(textControl);
        }