我试图寻找我的所有div一定文本“www.url.com”提取IDjQuery的查找文本和子元素
如果www.url.com发现我想提取表ID来自子表。
我的HTML是这样的:
<div class="box" id="results">
<div class="box-header">
<h1>www.url.com</h1>
</div>
<table cellpadding="0" cellspacing="0" border="0" class="display" id="24">
<thead>
<tr>
<th>col</th>
</tr>
<tr id="161">
<td class="kw" style="border-left: 1px solid white;border-right: 1px solid #F4F4F4;padding: 12px 14px;position: relative;text-align: left;">111111</td>
</tr>
</thead>
<tbody></tbody>
</table>
在这种情况下,我想找到ID = “24”。
这是我到目前为止有:
var foundin = $('*:contains("www.url.com")');
不知道如何获得ID :)
完美的作品!谢谢:) – Elvin
不用担心,随时接受! –
将在6分钟内完成 – Elvin