日期:2014-05-16 浏览次数:20371 次
1
判断select选项中?是否存在Value="paraValue"的Item?
?2
向select选项中?加入一个Item?
?3
从select选项中?删除一个Item?
?4
删除select中选中的项?
?5
修改select选项中?value="paraValue"的text为"paraText"?
?6
设置select中text="paraText"的第一个Item为选中?
?7
设置select中value="paraValue"的Item为选中?
?8
得到select的当前选中项的value?
?9
得到select的当前选中项的text?
10
得到select的当前选中项的Index?
11
清空select的项?
js?代码
//
?1.判断select选项中?是否存在Value="paraValue"的Item????????
function
?jsSelectIsExitItem(objSelect,?objItemValue)?
{????????
????
var
?isExit?
=
?
false
;????????
????
for
?(
var
?i?
=
?
0
;?i?
<
?objSelect.options.length;?i
++
)?
{????????
????????
if
?(objSelect.options[i].value?
==
?objItemValue)?
{????????
????????????isExit?
=
?
true
;????????
????????????
break
;????????
????????}
????????
????}
????????
????
return
?isExit;????????
}
?????????
???
//
?2.向select选项中?加入一个Item????????
function
?jsAddItemToSelect(objSelect,?objItemText,?objItemValue)?
{????????
????
//
判断是否存在????????
????
if
?(jsSe