var op=document.createElement("option") //新建option
op.setAttribute("value",0) // 设置value
op.appendChild(document.createTextNode("请选择---")) //text
sel.appendChild(op) // 为select添加option
这样就可以给select添加option了
欢迎分享,转载请注明来源:内存溢出
var op=document.createElement("option") //新建option
op.setAttribute("value",0) // 设置value
op.appendChild(document.createTextNode("请选择---")) //text
sel.appendChild(op) // 为select添加option
这样就可以给select添加option了
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)