Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <div id='idthatiknow'>
- <div>
- <span>good1</span>
- </div>
- <div>
- <span>good2</span>
- </div>
- <p>
- <span>bad</span>
- <div>
- <span>bad</span>
- </div>
- </p>
- <div>
- $('#idthatiknow span').filter(function() {
- return $(this).closest('p').length === 0;
- });
- #idthatiknow > div span { /* your styles here */}
- /* all spans with a direct child of div from #idthatiknow */
- #idthatiknow span:not(#idthatiknow > div span) { /* your styles here */}
- /* all spans except the ones with a direct child of div from #idthatiknow */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement