<script src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type="text/javascript"></script>
//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;
}
本文介绍了一个用于检查HTML中Select元素是否包含特定值的JavaScript函数。该函数通过遍历Select的所有选项并比较其值来确定目标项是否存在。
359

被折叠的 条评论
为什么被折叠?



