【发布时间】:2012-01-02 23:13:36
【问题描述】:
我遇到了以下问题
<a href="" class="so" title="Schuko"></a>
<a href="" class="so" title="French CEE17"></a>
$('a.so').live("click", function () {
var filter = $(this).attr("title");
if (filter) {
$('li:contains('+$(this).attr("title")+')').each(function(){
alert('yes');
});
}
return false;
});
<ul class="product_content">
<li class="prod" data-sockets="UK 15A CEE22 Schuko French Swiss Danish ">text goes here</li>
<li class="prod" data-sockets="UK 15A Schuko French CEE17 (16A) Socapex Harting Dutch Harting ">text goes here</li>
</ul>
我正在尝试遍历包含 data-sockets 值的所有内容以显示和隐藏其他 li 元素。
【问题讨论】:
-
你的问题是什么? ;-)
-
我认为这是您代码的总和,因为语法显然非常错误。你的问题的一些更多细节在这里真的会有所帮助。
标签: javascript jquery filter html-lists contains