开发者

Selecting a tag and class (jQuery)

Say I the following:

<div id = "thisOne">
<a href = "#" class="ui-state-highlight">abc</a>
<a href = "#'>def</a>
</div>

If i do $(".thisOne a") I get both "a" elements. I just want the one th开发者_如何学运维at is highlighted, how do I do this?


This two lines of code should help you, give them a try :

$("#thisOne .highlight")

and for the other

$("#thisOne :not(.highlight)")


This should do it: $('a.highlight');

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜