多应用+插件架构,代码干净,二开方便,首家独创一键云编译技术,文档视频完善,免费商用码云13.8K 广告
# 下拉选择框动态数据生成并加载 ~~~ <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Title</title> <script type="text/javascript"> window.onload=loadData; var datas=["南京","上海"]; function loadData() { alert(1); var selectObj=document.getElementById("citys"); for(var i in datas) { var opObj=document.createElement("option"); opObj.setAttribute("value",datas[i]); var node= document.createTextNode(datas[i]); opObj.appendChild(node); selectObj.appendChild(opObj); } } </script> </head> <body> <select id="citys"> <option value="-1">请选择城市</option> </select> </body> </html> ~~~