select赋值和取值

来源:互联网 发布:网络代写兼职 编辑:程序博客网 时间:2024/05/16 17:23

//加载页面维修费用分类数据到下拉框

        varall_optionsC = document.getElementById("classificationEdit").options;

        for(i = 0; i < all_optionsC.length; i++) {

            if(all_optionsC[i].text == classification) {

               all_optionsC[i].selected = true;

            }

        }

var obj = document.getElementById('classificationEdit');

var classification =obj.options[obj.selectedIndex].text;//分类获取文本

0 0
原创粉丝点击