现在的位置: 首页 > 综合 > 正文

js用createElement新创建的元素能调用id

2013年03月15日 ⁄ 综合 ⁄ 共 233字 ⁄ 字号 评论关闭

function fff(m){......}

var n=document.creatElementById("input")
    n.type="button";
    n.id="ss";
    n.onclick=fff(this.id); xxxxx
......

 

var n=document.creatElement("input")
    n.type="button";
    n.id="ss";
    n.onclick=function(){fff(this.id);}

抱歉!评论已关闭.