可以这么写:
var input = document.createElement("input");
document.body.appendChild(input);
也可以这么写,例如你想要添加的控件在id为"divId"这个div上显示
document.getElementById("divId").innerHTML = '';
function createInput(){
var input = document.createElement("input");
document.body.appendChild(input);
}