例如:你要在一个id为td_paydate的td里面创建一个输入框
function $(id)
{
return document.getElementById(id);
}
fucntion test()
{
var td_paydate=$("td_paydate");
var newinput=document.createElement("input");
inp.setAttribute("type","text");
inp.setAttribute("id","aa");
//inp.setAttribute("className","Wdate");//写成className在IE下可以firefox不行,class在IE下不适用,在firefox下可以
inp.className="Wdate";//这种方法两个浏览器都行
//inp.setAttribute("onfocus","WdatePicker()");//这种方法在IE下不行
inp.onclick=function(){WdatePicker();};//这种方法两种浏览器都行
document.getElementById("td_paydate").appendChild(inp);
}