0
是否有一个匹配精确文本匹配的选择器?例如,如果我与Matt Black和Black有<select>
,并且我尝试做'#field option:contains("Black")'
虽然我想选择Black,但我会得到Matt Black。:eq for text类似于:包含在jquery
:eq查找索引n - 有没有更好的方法根据它的文本内容来选择<option>
节点?
是否有一个匹配精确文本匹配的选择器?例如,如果我与Matt Black和Black有<select>
,并且我尝试做'#field option:contains("Black")'
虽然我想选择Black,但我会得到Matt Black。:eq for text类似于:包含在jquery
:eq查找索引n - 有没有更好的方法根据它的文本内容来选择<option>
节点?
尝试:
$('someElement').filter(function() {
return $(this).text() == 'Some text';
});
的[jQuery选择,包含等于]
可能重复(http://stackoverflow.com/questions/7344220/jquery-selector-contains-to-equals) – 2012-02-24 07:38:10