我遇到了jQuery查詢問題。構建jQuery查詢需要幫助
考慮以下(瘋了)HTML例子:
<!-- this is the outermost condition -->
<div id="condition">
<!-- this is a tag that I am looking for -->
<input type="text" />
<div id="condition">
<input type="radio" />
</div>
<div>
<div id="condition">
<input type="checkbox" />
</div>
<!-- this is a tag that I am looking for -->
<input type="text" />
</div>
</div>
鑑於上面的例子中,標記和最外側的條件(在上面看到的),我怎麼能得到所有輸入單元內的情況下,那也不是內在條件的成員?
我已經提供了示例,以便您可以查看哪些標記我希望查詢返回。
在單個頁面上有重複的id是無效的HTML。考慮使用類來代替。 –
你嘗試過什麼嗎? –