js动态创建控件不支持事件
var div = document.createElement("div");var f = document.createElement("input");
f.setAttribute("type", "text")
f.setAttribute("name", "text"+thumbs)
f.setAttribute("class","b")
f.setAttribute("size", "40")
div.appendChild(f)
var w=document.createElement("input");
w.setAttribute("type", "button")
w.setAttribute("name", "button1")
w.setAttribute("class","input2")
w.setAttribute("value", "上传图片")
w.setAttribute("onclick", "javascript:window.open('/fd_upload/upload.asp?formname=add_pro&typ=smail&editname=text"+thumbs+"&imagename=image1&uppath=/fd_upimg/product/small','','status=no,scrollbars=no,top=310,left=380,width=420,height=165')")
div.appendChild(w)
document.getElementById("_container").appendChild(div);
}
创建这样一个按钮点击时,里面的onclick事件没反应,,在IE8可以。