Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I want to do something with var p:

var p = $("li:last");

But I don't want to do anything if there is a certain Class appended. I tried :not like this:

var p = $("li:last:not(.Class)");

This doesn't work. How can I exclude .Class in my var?

question from:https://stackoverflow.com/questions/10216669/how-to-write-if-not-class-jquery-selector

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
131 views
Welcome To Ask or Share your Answers For Others

1 Answer

var p = $("li:last").not(".Class");

http://api.jquery.com/not/


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...