I’m trying to filter a list of elements via ‘:not()’, and jQuery seems to be ignoring my filter.
here is the code:
myElements.filter(':not(.someclass)');
jquery still selects all of myElements…
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
or:
You will actually need to assign the filtered collection to a variable to capture the modified (filtered) collection, otherwise you are effectively just referencing
myElementsin its initial state. If you don’t want to do that, you can always use chaining, for example: