Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

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.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8391505
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T19:16:50+00:00 2026-06-09T19:16:50+00:00

Goal: no red outlines on p tags inside of .third classes. Self-contained example below,

  • 0

Goal: no red outlines on p tags inside of .third classes.

Self-contained example below, or jsfiddle here: http://jsfiddle.net/WJVBm/

Desperately looking forward to awarding a green checkmark… Thanks in advance for any help!

<!DOCTYPE html>
<html>
<head>
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js"></script>
    <script type="text/javascript">
    $(function() {
        var myDivs = $('div');

        var myFilteredDivs = myDivs.filter(function(){
            return $(this).closest('.third').length == 0;
        });

        var myFilteredParagraphs = myFilteredDivs.find('p'); // why does this find paragraphs in divs that have already been filtered out of the collection?

        myDivs.css('border', '1px solid #CCC');
        myFilteredDivs.css('border', '1px solid blue');
        myFilteredParagraphs.css('border', '1px solid red'); // paragraphs inside of divs that should not exist in the collection are still being outlined by a red border

    });
    </script>
    <style type="text/css">
        div { float: left; padding: 20px; margin: 5px; }
    </style>
</head>

<body>

    <div class="first">
        <p>first</p>
        <div class="second">
            <p>second</p>
            <div class="third">
                <p>third</p>
            </div>
        </div>
        <div class="second">
            <p>second2</p>
        </div>
        <div class="third">
            <p>third2</p>
        </div>
    </div>

</body>
</html>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T19:16:52+00:00Added an answer on June 9, 2026 at 7:16 pm

    Try this http://jsfiddle.net/3JALD/

    It probably can be improved but it seems to do what you need.

    All of the paragraphs were found for myFilteredParagraphs because div.first was part of myFilteredDivs and find() gets all of the ps that are descendent from div.first.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

code: http://jsfiddle.net/xVCrn/1/ (works best in chrome / webkit) I'm trying to get the red
GOAL : To customize the background view of cell. Here is what I am
Goal: to create a percentage column based off the values of calculated columns. Here's
Ok so the goal of this program is to get the red x from
Here is the little example of my two worksheets. Original Sheet : As you
Goal : I wants when I drag image it become fade so we can
Goal is to make a dialog that appears on menu_key pressed, but it keeps
Goal: Once i click on the start button on my user interface, i currently
Goal: Produce an Excel document with information from 3 associated models that is similar
Goal I am building an Eclipse plugin targeting the 3.7 environment and would like

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.