网站开发与移动开发

博客园 首页 新随笔 管理

2009年6月22日 #

摘要: 设置select中value="paraValue"的Item为选中 //document.all.objSelect.value = objItemValue; //得到select的当前选中项的value //var currSelectValue = document.all.objSelect.value; //得到select的当前选中项的text //var currSelectText = document.all.objSelect.options[document.all.objSelect.selectedIndex].text; //得到select的 阅读全文
posted @ 2009-06-22 09:32 txf2004 阅读(188) 评论(0) 推荐(0) 编辑

摘要: 设置select中text="paraText"的第一个Item为选中 function jsSelectItemByValue(objSelect,objItemText) { //判断是否存在 var isExit = false; for(var i=0;i<objSelect.options.length;i++) { if(objSelect.options[i].text == objItemText) { objSelect.options[i].selected = true; isExit = true; break; } } //Show出结果 i 阅读全文
posted @ 2009-06-22 09:28 txf2004 阅读(219) 评论(0) 推荐(0) 编辑