我正在尝试根据满足的特定条件执行某些操作。但是 jquery 代码似乎不起作用。
HTML:
<p class="Mycondition">
<span><b>»</b></span>
<span id="nav"><a href="#" id="lnkMycondition">Overview</a>
<span class="separator">
<b>»</b>
</span>
</span>
<span><b>MyName</b></span>
</p>
<div class="prepend-1 span-22">
<table class="hor" title="">
<tbody>
<tr>
<td>abc</td><td>1</td>
</tr>
</tbody></table>
</div>
查询:
$('table').each(function () {
if ($('#Mycondition').children(':contains("MyName")')) {
// do stuff
}
});