portal html css js resource

select.js 1.5KB

    var ps = new Array( new Array('130','高分子材料学'), new Array('140','高分子材料学2'), new Array('150','高分子材料学3'), new Array('160','高分子材料学4') ); var cs = new Array( new Array('130100','材料学'), new Array('130200','材料学'), new Array('130300','材料学'), new Array('130400','材料学'), new Array('130500','衡水'), new Array('140100','郑州'), new Array('140200','洛阳'), new Array('140300','开封'), new Array('140400','新乡'), new Array('150100','哈尔滨'), new Array('150200','齐齐哈尔'), new Array('150300','佳木斯'), new Array('150400','大庆'), new Array('160100','大连'), new Array('160200','鞍山'), new Array('160300','抚顺'), new Array('160400','锦州'), new Array('160500','沈阳'), new Array('160600','登封'), new Array('160700','葫芦岛') ); function fillp(){ var p =document.getElementById("p"); for(i=0;i<ps.length;i++){ p.options[i+1]= new Option(ps[i][1],ps[i][0]); } } function fillc(code){ var n = 1; var c = document.getElementById("c"); var m = c.options.length; for(j=0;j<m;j++){ c.options.remove(1); } for(i=0;i<cs.length;i++){ var d = cs[i][0]; var s = d.substring(0,3); if(code==s){ c.options[n] = new Option(cs[i][1],cs[i][0]); n++; } } }