Skip to content

Instantly share code, notes, and snippets.

@Macagare
Created November 9, 2012 15:02
Show Gist options
  • Save Macagare/4046188 to your computer and use it in GitHub Desktop.
Save Macagare/4046188 to your computer and use it in GitHub Desktop.
Javascript: jquery find parent
//Find a parent div by id where display is none:
/*
<div id="#extended_selectors"...>
...
<span id="lorem"... />
</div>
*/
if( $(id).parents().find("#extended_selectors").css('display') == "none" ) {
console.log("found");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment