I am trying to show the first child of an element which does not have a class of "submitted"
我正在尝试显示一个元素的第一个子元素它没有一个“submit”类
So something like
所以类似
$('#menu li:first-child:not(".submitted")').show();
HTML:
HTML:
<ul id="menu">
<li class="submitted">stuff here</li>
<li class="submitted">stuff here</li>
<li>stuff here</li> <!-- This one needs to be shown -->
<li>stuff here</li>
<li>stuff here</li>
</ul>
Any ideas??
有什么想法?
5 个解决方案
#1
20
$('#menu li:not(.submitted):first')
#2
5
Try this:
试试这个:
$('#menu li:not(".submitted"):first').show();
http://jsfiddle.net/WDx3M/
#3
2
$('#menu li:first-child').not(".submitted").show();
#5
-1
yes it does work.You can have look at this example http://jsfiddle.net/gFutw/
是的它的工作。您可以查看这个示例http://jsfiddle.net/gFutw/。
#1
20
$('#menu li:not(.submitted):first')
#2
5
Try this:
试试这个:
$('#menu li:not(".submitted"):first').show();
http://jsfiddle.net/WDx3M/
#3
2
$('#menu li:first-child').not(".submitted").show();
#4
#5
-1
yes it does work.You can have look at this example http://jsfiddle.net/gFutw/
是的它的工作。您可以查看这个示例http://jsfiddle.net/gFutw/。