//下拉列表填充元素
function selectSetData(data)
{
var selectDom=document.getElementById("下拉列表Id");
//设置长度为0
selectDom.length=0;
for (let index = 0; index < data.length; index++) {
var optin=new Option(data[i].id,data[i].name);
//添加元素到下拉列表
selectDom.add(optin);
}
}
js下拉列表填充元素
转载本文章为转载内容,我们尊重原作者对文章享有的著作权。如有内容错误或侵权问题,欢迎原作者联系我们进行内容更正或删除文章。
上一篇:树的基本概念与二叉树相关
下一篇:Nacos集群搭建
提问和评论都可以,用心的回复会被更多人看到
评论
发布评论
相关文章