本帖最后由 wzcxm 于 2013-09-30 12:09:41 编辑

解决方案 »

  1.   

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <title> New Document </title>
    <meta name="Generator" content="EditPlus">
    <meta name="Author" content="">
    <meta name="Keywords" content="">
    <meta name="Description" content="">
    <script src="http://code.jquery.com/jquery-latest.js"></script>
    <script>
    $(function(){
    alert($("select").find("option[value='a']").length); //非0就是找到了
    alert($("select").find("option[value='d']").length); //0是没找到
    });
    </script>
    </head>
    <body>
    <select id="s">
    <option value="a">a</option>
    <option value="b">b</option>
    <option value="c">c</option>
    </select>
    </body>
    </html>
      

  2.   

    我已近搞定了,谢谢各位大神
     function isExist(listbox,id)
        {   
            if(listbox!=null&&listbox.options.length)
            {
                for(var i=0;i<listbox.options.length;i++)
                {
                    if(id==listbox.options[i].id)
                    {
                        return true;
                    }
                }
            }
            return false;
        }