取出页面中包含属性relatedId='firPer'的表单,页面表单有input,也有label。

解决方案 »

  1.   

    我说的很明白了吧
    取出页面中包含属性relatedId="firPer"的所有表单。。
      

  2.   

    希望对楼主有用
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <title></title>
        <script src="Scripts/jquery-1.4.1.min.js" type="text/javascript"></script>
    </head>
    <body>
        <form relatedid='firPer'>
        <input type="button" />
        <input type="checkbox" />
        <input type="file" />
        </form>
        <select>
            <option>Option</option>
        </select>
        <textarea></textarea>
        <button>
            Button</button>
    </body>
    </html>
    <script>
        //遍历relatedid='firPer'下面的表单元素,如果取值的话,同理可得
        $("[relatedid='firPer'] >input").each(function () {
            alert($(this)[0].type);
        });
    </script>