Tuesday, 20 August 2013

Find by both conditions (both conditions appear)

Find by both conditions (both conditions appear)

I have the next li-s:
your ad was Approved
your name was Approved
your ad was Deleted
I want to find by both conditions:
I tried the next thing:
$("#notification-list").find(
"li:contains('was Approved'), li:not(:contains('your ad'))).each(function
() {
}
but I got:
your ad was Approved (I got it cause 'your ad' is found here and 'was
Approved')
your name was Approved (I got it cause 'was Approved' is found)
your ad was Deleted (I got it cause 'your ad' is found)
I want to get only the items that contains both things:
your ad was Approved (I got it cause 'your ad' is found here and 'was
Approved')
I tried:
$("#notification-list").find(
"li:contains('was Approved') and li:not(:contains('your
ad'))).each(function () {
}
but it doesn't work.
any help appreciated!

No comments:

Post a Comment