jquery选取name属性的第11个字符为3的控件

解决方案 »

  1.   

    用jquery的filter的方法<script type="text/javascript">
            $(function () {
                var $item = $("input").filter(function (index) {
                    return $(this).attr("name").substring(10, 11) == "3";
                })
                alert($item.val());
            })
        </script><input type="text" name="asdfghjklq3" value="3333" />;
        <input type="text" name="asdfghjklq4" value="4444" />;亲测,可以,LZ可以试试