0
所以我試圖根據完全匹配顯示幾行(不想僅僅是包含因爲21和12都匹配'1')。基於完全匹配的jquery顯示行
這裏是JavaScript:
$("tr:has(.logType:contains('" + curr + "'))").filter(function() {
return $(this).text == curr;
}).removeAttr("style");
和HTML:
<table>
<thead>
<tr>
...
<th class="logType">
Log Type
<!-- some options -->
</select>
</th>
<thead>
<tbody>
...
<tr>
<td class="logType">
<!-- some content -->
</td>
</tr>
</tbody>
目前jQuery的內部條件從不返回true,即使有多個準確匹配。