I’m trying to find all the parent elements that have the CSS style display:none. I can’t seem to get it to work though. Here’s what I’ve got:
var $parents = $(...).parents("[css=display:none]");
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.
If you want the ones that are actually
display: none;(not just possibly contained in anotherdisplay: none;), you can use.filter()and.css()to get those parents, like this:This gets the parents, then filters them to get only the ones that are
display: none;on that specific parent.