通过 action 传过来的值在 option 获取进行验证,下面有个不错的示例,需要的朋友不要错过
Javascript 是一种由 Netscape 的 LiveScript 发展而来的原型化继承的基于对象的动态类型的区分大小写的客户端脚本语言,主要目的是为了解决服务器端语言,比如 Perl,遗留的速度问题,为客户提供更流畅的浏览效果。
通过 action 传过来的值在 option 获取进行验证的方法:
- for(var i=0;i<document.getElementById("ufacilityType").options.length;i++){
- if(document.getElementById("ufacilityType").options[i].text==datas[0].facilityType){
- document.getElementById("ufacilityType").options[i].selected=true;
- break;
- }
- }
来源: